glide是Go的一個依賴管理工具(非官方的),我下載了0.13.1這個Release版本,而後發如今windows上執行glide install
後出錯git
[ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied. 0 dir(s) moved
google一下發現緣由在於github.com/Masterminds/glide/path/winbug.go裏的CustomRename函數github
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) output, err := cmd.CombinedOutput() if err != nil { return fmt.Errorf("Error moving files: %s. output: %s", err, output) }
發生錯誤行在cmd := exec.Command("cmd.exe", "/c", "move", o, n)這裏,調用windows上move函數發生權限錯誤。
google一下能夠改成(根據原來的提交記錄):windows
cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\")
在glide源碼目錄從新編譯生成glide.exe,而後放到$GOPATH/bin目錄下(記得把這個目錄放到環境變量PATH裏)ide
不過,以後應該很快會修復掉這個問題的^_^函數