Bug Replay
[ERROR] Unable to export dependencies to vendor Directory:error moving files:exit status 1. Output:access is denied. 0 dir (s) moved
Solution Solutions
The first step
Locate this file github.com/masterminds/glide/blob/master/path/winbug.go//Customremoveall is similar to OS. RemoveAll but deals with the bug outlined//at Https://github.com/golang/go/issues/20841.func customremoveall (p string) E rror {//Handle the Windows case first if runtime. GOOS = = "Windows" {msg. Debug ("detected Windows. Removing files using Windows command ") cmd: = exec. Command ("cmd.exe", "/C", "rd", "/S", "/Q", p)//mainly modify this line of code to replace it with cmd: = exec. Command ("cmd.exe", "/C", "xcopy/s/y", O, n+ "\") output, err: = cmd. Combinedoutput () if err! = Nil {exitCode: = Getexitcode (ERR) if exitCode! = WINERRORFILENOTF Ound && ExitCode! = winerrorpathnotfound {return FMT. Errorf ("Error removing files:%s. Output:%s", err, Output)}} return nil} else if DETECTWSL () {cmd: = exec. Command ("rm", "-RF", p) output, err2: = cmd. Combinedoutput () Msg. Debug ("Detected Windows subsysteM for Linux. Removing files using subsystem command ") if ERR2! = nil {return FMT. Errorf ("Error removing files:%s. Output:%s", ERR2, Output)} return nil} return OS. RemoveAll (P)}
Step two, recompile the Glide.go file
go build glide.go
The third step is to copy the generated executable file Glide.exe to the bin directory under Gopath (this directory is a system environment variable, so put it in the directory)
The fourth step is to discuss the solution in more detail https://github.com/Masterminds/glide/issues/873
[Golang] Glide Package management tool, bug fix scheme on WINDOWS10 64-bit system