From 82913a7c45fd9d000c410359c255660fe789d5ec Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:02:32 +0000 Subject: [PATCH] Excavator: Manage go module dependencies (#303) --- go.mod | 2 +- go.sum | 4 ++-- .../palantir/conjure-go/v6/conjure/conjure.go | 11 ++++++++++- vendor/modules.txt | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index b17f75d3..c315e86c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/mholt/archiver v2.1.0+incompatible github.com/nmiyake/pkg/dirs v1.1.0 - github.com/palantir/conjure-go/v6 v6.37.0 + github.com/palantir/conjure-go/v6 v6.38.0 github.com/palantir/distgo v1.48.0 github.com/palantir/godel/v2 v2.74.0 github.com/palantir/pkg/cobracli v1.2.0 diff --git a/go.sum b/go.sum index 85537ed6..fedfaf04 100644 --- a/go.sum +++ b/go.sum @@ -179,8 +179,8 @@ github.com/nmiyake/pkg/gofiles v1.2.0 h1:L0LWMfnHyMxiLP2Cuqno163/4zK73FscEsNd7sH github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/palantir/conjure-go/v6 v6.37.0 h1:enCKWJ/jZ/6RcrPH0PiqlT5vL8K8u8z0LMnQ57Jd1Hs= -github.com/palantir/conjure-go/v6 v6.37.0/go.mod h1:5JABvWotZsGYF8NSCJjAH7A30o/P78wUOezivKvZxSQ= +github.com/palantir/conjure-go/v6 v6.38.0 h1:CZIwruh75JSgnG9zxOpw5RW4Z7dDg0OhVkhBD7KW6aI= +github.com/palantir/conjure-go/v6 v6.38.0/go.mod h1:5JABvWotZsGYF8NSCJjAH7A30o/P78wUOezivKvZxSQ= github.com/palantir/distgo v1.48.0 h1:gxucnEDEmHES9u494On761S9iCxW38aqGh7t4YwJBX0= github.com/palantir/distgo v1.48.0/go.mod h1:9Vq7y2qcgjZgRzwa2gdbuJUdkhlLKHKIX5ZVqf3/SuE= github.com/palantir/distgo/pkg/git v1.0.0 h1:bryRJ9ZdJapz5tGzd/snv6U66tLxyb1b4PbPya/aqD4= diff --git a/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go b/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go index 3214a9c1..cf9fc707 100644 --- a/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go +++ b/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go @@ -16,6 +16,7 @@ package conjure import ( "path/filepath" + "regexp" "sort" "github.com/dave/jennifer/jen" @@ -118,7 +119,11 @@ func newJenFile(pkg types.ConjurePackage, def *types.ConjureDefinition) *jen.Fil f := jen.NewFilePathName(pkg.ImportPath, pkg.PackageName) f.ImportNames(snip.DefaultImportsToPackageNames) for _, conjurePackage := range def.Packages { - f.ImportName(conjurePackage.ImportPath, conjurePackage.PackageName) + if packageSuffixRequiresAlias(conjurePackage.ImportPath) { + f.ImportAlias(conjurePackage.ImportPath, conjurePackage.PackageName) + } else { + f.ImportName(conjurePackage.ImportPath, conjurePackage.PackageName) + } } return f } @@ -129,3 +134,7 @@ func newGoFile(filePath string, file *jen.File) *OutputFile { file: file, } } + +func packageSuffixRequiresAlias(importPath string) bool { + return regexp.MustCompile(`/v[0-9]+$`).MatchString(importPath) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 13388608..66862fe2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -72,7 +72,7 @@ github.com/nmiyake/pkg/errorstringer # github.com/nwaples/rardecode v1.0.0 ## explicit github.com/nwaples/rardecode -# github.com/palantir/conjure-go/v6 v6.37.0 +# github.com/palantir/conjure-go/v6 v6.38.0 ## explicit; go 1.19 github.com/palantir/conjure-go/v6/conjure github.com/palantir/conjure-go/v6/conjure-api/conjure/spec