You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: Research the various Gopkg name formats and convert them correctly
What feature or behavior is this required for?
Make sure we are in fact handling all the GoPkg formats that are possible.
How could we solve this issue? (Not knowing is okay!)
Add them and delete that comment once we have the definitive list....and maybe we are good already but this issue if to validate that.
func convertGopkgNameToPurl(name string) (rename string) {
switch {
case githubPattern.MatchString(name):
rename = githubPattern.ReplaceAllString(name, "golang/github.com/$1/$2")
case gopkg2Pattern.MatchString(name):
rename = gopkg2Pattern.ReplaceAllString(name, "golang/github.com/$1/$2")
case gopkg1Pattern.MatchString(name):
rename = gopkg1Pattern.ReplaceAllString(name, "golang/github.com/go-$1/$1")
default:
rename = "golang/" + name
}
return
}
This function was mainly made to coerce some of the goofier golang URLs of old into something a bit more "authoritative". The patterns it looks for are:
var gopkg1Pattern = regexp.MustCompile("^gopkg.in/([^.]+).*")
var gopkg2Pattern = regexp.MustCompile("^gopkg.in/([^/]+)/([^.]+).*")
var githubPattern = regexp.MustCompile("^github.com/([^/]+)/(.*)")
Basically, it would be nice to know if we are missing any! These were just the oddballs we knew of, and are mostly a result of the pre dep and pre go mod versions of how you got dependencies in the Golang world.
Idk man ask @DarthHater .... he added this comment awhile ago ;P
nancy/packages/packages.go
Line 30 in a76019e
What feature or behavior is this required for?
Make sure we are in fact handling all the GoPkg formats that are possible.
How could we solve this issue? (Not knowing is okay!)
Add them and delete that comment once we have the definitive list....and maybe we are good already but this issue if to validate that.
Anything else?
cc @bhamail / @DarthHater
The text was updated successfully, but these errors were encountered: