golang-glide win10에서 "dependencies to vendor directory: Error moving files"오류 해결
5049 단어 go
func CustomRename(o, n string) error {
// Handking windows cases first
if runtime.GOOS == "windows" {
msg.Debug("Detected Windows. Moving files using windows command")
//cmd := exec.Command("cmd.exe", "/c", "move", o, n) //
cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") //
output, err := cmd.CombinedOutput()
//fmt.Println("CustomRename:",output,err)
if err != nil {
return fmt.Errorf("Error moving files: %s. output: %s", err, output)
}
return nil
} else if detectWsl() {
cmd := exec.Command("mv", o, n)
output, err2 := cmd.CombinedOutput()
msg.Debug("Detected Windows Subsystem for Linux. Removing files using subsystem command")
if err2 != nil {
return fmt.Errorf("Error moving files: %s. output: %s", err2, output)
}
return nil
}
return os.Rename(o, n)
}
수정이 끝난 후,glide로 컴파일합니다.exe, 환경 변수 경로 아래 [$gopath/bin]을 놓습니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Go Fiber 및 PlanetScale로 REST API 구축 - 4부다시 사용자 핸들러에 UpdateUser라는 새 함수를 추가합니다. 업데이트 사용자를 main.go에 등록 이제 응용 프로그램을 다시 실행하십시오. 이전에 생성한 사용자를 업데이트합니다. 응답 사용자가 존재하지 않을...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.