-
Notifications
You must be signed in to change notification settings - Fork 46
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
Golang support #113
base: main
Are you sure you want to change the base?
Golang support #113
Conversation
Signed-off-by: Gergely Csatari <[email protected]>
Signed-off-by: Gergely Csatari <[email protected]>
# https://stackoverflow.com/questions/57355929/what-does-incompatible-in-go-mod-mean-will-it-cause-harm | ||
if "-" in purl_data.version: | ||
version = purl_data.version.split("-") | ||
if exp.match(purl_data.name): |
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.
What's the point of this check? Do go package names sometimes have v[0-9]+ in them? Why do we use the name in the download_url in that case?
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.
Maybe this check should actually be:
if len(namespace) >= 3:
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, perhaps this check is looking for modules with backward incompatiable changes as explained here: https://go.dev/doc/modules/release-workflow
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.
Maybe the checks could instead be replaced by:
if len(namespace_parts) == 2:
return (
f"https://{namespace_parts[0]}/{namespace_parts[1]}/{purl_data.name}"
f"/tree/{version}"
)
else:
return (
f"https://{namespace_parts[0]}/{namespace_parts[1]}/{namespace_parts[2]}"
f"/tree/{version}"
)
I don't see the need for the regular expression check because the backwards incompatiable changes always occur at the 3rd portion of the namespace anyway right?
A very basic implementation for golang support. Supports most of the golang purls what I tested with, but not perfect.