mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
zip.Close() also clears the GOPATH of the underlying diskRef (#367)
* zip.Close() also clears underlying diskRef * remove unnecessary constructor * use GoBinPath() in example
This commit is contained in:
committed by
Marwan Sulaiman
parent
6548509896
commit
bbe1ce1873
@@ -38,22 +38,19 @@ func (g *goGetFetcher) Fetch(mod, ver string) (Ref, error) {
|
||||
sourcePath := filepath.Join(goPathRoot, "src")
|
||||
modPath := filepath.Join(sourcePath, getRepoDirName(mod, ver))
|
||||
if err := g.fs.MkdirAll(modPath, os.ModeDir|os.ModePerm); err != nil {
|
||||
diskRef := newDiskRef(g.fs, goPathRoot, "", "")
|
||||
diskRef.Clear()
|
||||
clearFiles(g.fs, goPathRoot)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// setup the module with barebones stuff
|
||||
if err := Dummy(g.fs, modPath); err != nil {
|
||||
diskRef := newDiskRef(g.fs, goPathRoot, "", "")
|
||||
diskRef.Clear()
|
||||
clearFiles(g.fs, goPathRoot)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = getSources(g.goBinaryName, g.fs, goPathRoot, modPath, mod, ver)
|
||||
if err != nil {
|
||||
diskRef := newDiskRef(g.fs, goPathRoot, "", "")
|
||||
diskRef.Clear()
|
||||
clearFiles(g.fs, goPathRoot)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user