-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing ./pkg/repo #316
Removing ./pkg/repo #316
Conversation
in favor of a function that does the same thing
hopefully this is easier to read
the ref returned from fetch does it
calls to fetch will fail if vgo is not installed
and using the new module go get fetcher
This removes code that is no longer used and depends on the ./pkg/repo package
if err != nil { | ||
return err | ||
} | ||
ret, err := ref.Read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you check the err somewhere?
func (s *ModuleSuite) TestNewGoGetFetcher() { | ||
r := s.Require() | ||
fs := s.fs | ||
fetcher, err := NewGoGetFetcher(fs, repoURI, version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewGoGetFetcher func has only one arg.
// we need to use an OS filesystem because fetch executes vgo on the command line, which | ||
// always writes to the filesystem | ||
fs := afero.NewOsFs() | ||
fetcher, err := NewGoGetFetcher(fs, repoURI, version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewGoGetFetcher func has only one arg.
// TODO: return a ref for cleaning up the goPathRoot | ||
return nil, err | ||
} | ||
sourcePath := filepath.Join(goPathRoot, "src", goPathRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be sourcePath := filepath.Join(goPathRoot, "src")
?
goGetFetcher, ok := fetcher.(*goGetFetcher) | ||
r.True(ok) | ||
r.Equal(repoURI, goGetFetcher.repoURI) | ||
r.Equal(version, goGetFetcher.version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields repoURI and version do not exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after pull 291 is updated plus @marpio's comments.
|
||
// save it | ||
if err := s.Save(context.Background(), module, version, modBytes, zipFile, infoBytes); err != nil { | ||
if err := s.Save( | ||
context.Background(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd put a contextWithTimeout if there's no context being passed from above.
|
||
func (s *ModuleSuite) TestNewGoGetFetcher() { | ||
r := s.Require() | ||
fs := s.fs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to assign a new variable here, just use s.fs
once below.
_, err = e.Append(eventlog.Event{ | ||
Module: modName, | ||
Version: version, | ||
Time: time.Now(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use UTC?
This is a follow-up to #291 that removes the
./pkg/repo
package and replaces calls to it with the new./pkg/module
functionality that #291 added. #314 requires this.Requires #291 before merging this. Requires #291. Check out more details on why this is opened against #291 at #290 (comment)
This is part of #290
The only addition on top of #291 is 244014e. Refer to #291 for all other changes