Skip to content

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add single file support #1

wants to merge 9 commits into from

Conversation

Vaxuite
Copy link
Collaborator

@Vaxuite Vaxuite commented Aug 17, 2021

No description provided.

@@ -0,0 +1,6 @@
module easteregg
Copy link
Owner

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"
Copy link
Owner

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"
Copy link
Owner

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
Copy link
Owner

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?

@@ -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)
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants