[Golang] Glide Package management tool, bug fix scheme on WINDOWS10 64-bit system

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.