-
Notifications
You must be signed in to change notification settings - Fork 5
Add single file support #1
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
base: master
Are you sure you want to change the base?
Conversation
examplerepo/go.mod
Outdated
@@ -0,0 +1,6 @@ | |||
module easteregg |
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.
why is this file being committed? it's supposed to be a temporary file
} | ||
buildDir = fmt.Sprintf("third_party/go/%s", pathMinusEnd) | ||
} else { | ||
buildDir = "third_party/go" |
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.
think this would be neater if we just instantiated buildDir := "third_party/go" and then modified it if not single file build?
} | ||
buildDir = fmt.Sprintf("third_party/go/%s", pathMinusEnd) | ||
} else { | ||
buildDir = "third_party/go" |
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.
same here
@@ -238,6 +251,12 @@ func (vd *VersionDirectory) SetVersion(version string, mod *Module) *Module { | |||
// If incoming is less than existing, return existing. | |||
return existingMod | |||
} | |||
if major == "v1" && existingMajor == "v0" { | |||
delete(vd.versions, existingVers) | |||
vd.versions[version] = mod |
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.
wouldn't we then want to return mod
here?
module/directory.go
Outdated
@@ -33,10 +33,16 @@ func NewDirectory() *Directory { | |||
|
|||
// Sync is a lazy implementation to refresh all of the module dependencies to the closest semver. | |||
func (d *Directory) Sync() { | |||
names := make(map[string]bool, 0) |
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.
as a nit, for these maps which are only use to check if a key has been "seen", it's generally better practice to have it be map[string]struct{}
as then you don't need to worry about what the value is, just whether or not the key exists.
No description provided.