Skip to content

Commit

Permalink
Specially handle google.golang.org/protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
amake committed Jan 18, 2024
1 parent 9cda018 commit 055169e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions go2port.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,16 @@ func newPackage(pkg string, version string) (Package, error) {
ResolvedId: pkg,
Version: version,
}
// Special case for protobuf, which is a very common dependency but is
// canonically hosted on go.googlesource.com which can't serve stable
// tarballs.
if pkg == "google.golang.org/protobuf" {
ret.Host = "github.com"
ret.Author = "protocolbuffers"
ret.Project = "protobuf-go"
ret.ResolvedId = "github.com/protocolbuffers/protobuf-go"
return ret, nil
}
switch parts[0] {
case "golang.org":
if len(parts) < 3 {
Expand Down

0 comments on commit 055169e

Please sign in to comment.