Skip to content
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

Parse a Resolved Dependencies json File for Go #483

Merged
merged 4 commits into from
Nov 24, 2020

Conversation

mikeyoung85
Copy link
Contributor

No description provided.

@@ -140,6 +144,10 @@ def self.parse_go_sum(file_contents)
deps.uniq
end

def self.parse_go_resolved(file_contents)
JSON.parse(file_contents).map { |dep| { name: dep["Path"], requirement: dep["Version"], type: 'runtime' } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to skip the ones that are Main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a filter in here

@@ -140,6 +144,12 @@ def self.parse_go_sum(file_contents)
deps.uniq
end

def self.parse_go_resolved(file_contents)
JSON.parse(file_contents)
.select { |dep| dep["Main"] == "false" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't matter but maybe dep["Main"] != "true" ?

Copy link
Contributor

@jsonperl jsonperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! 🎉

Copy link
Contributor

@jsonperl jsonperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually, don't forget a Version bump.

@mikeyoung85 mikeyoung85 merged commit 3d8b99b into master Nov 24, 2020
@mikeyoung85 mikeyoung85 deleted the mikeyoung85/go-custom-manifest branch November 24, 2020 19:41
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