-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
lib/bibliothecary/parsers/go.rb
Outdated
@@ -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' } } |
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 think we want to skip the ones that are Main
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'll add a filter in here
lib/bibliothecary/parsers/go.rb
Outdated
@@ -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" } |
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 matter but maybe dep["Main"] != "true"
?
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.
Wonderful! 🎉
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.
Oh actually, don't forget a Version bump.
No description provided.