From 44ba711bfcf4028b8697895d3d60f3ec4ca713b3 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 1 Feb 2023 17:19:45 +0000 Subject: [PATCH] Excavator: Manage go module dependencies (#302) --- go.mod | 2 +- go.sum | 4 ++-- .../palantir/conjure-go/v6/conjure/conjure.go | 16 ---------------- .../palantir/conjure-go/v6/conjure/outputs.go | 5 +---- vendor/modules.txt | 2 +- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index fe5232d0..b17f75d3 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.36.0 + github.com/palantir/conjure-go/v6 v6.37.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 50e7f7fb..85537ed6 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.36.0 h1:s1iawI2QFFyH85qSOe5JUViX4j/g0x5SHSVJdmJUFYc= -github.com/palantir/conjure-go/v6 v6.36.0/go.mod h1:5JABvWotZsGYF8NSCJjAH7A30o/P78wUOezivKvZxSQ= +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/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 e65639e2..3214a9c1 100644 --- a/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go +++ b/vendor/github.com/palantir/conjure-go/v6/conjure/conjure.go @@ -15,7 +15,6 @@ package conjure import ( - "os" "path/filepath" "sort" @@ -23,7 +22,6 @@ import ( "github.com/palantir/conjure-go/v6/conjure-api/conjure/spec" "github.com/palantir/conjure-go/v6/conjure/snip" "github.com/palantir/conjure-go/v6/conjure/types" - "github.com/palantir/go-ptimports/v2/ptimports" "github.com/pkg/errors" ) @@ -32,25 +30,11 @@ func Generate(conjureDefinition spec.ConjureDefinition, outputConfiguration Outp if err != nil { return err } - // write the generated files for _, file := range files { if err := file.Write(); err != nil { return err } } - // format all the generated files after they have been written. - // Must be done after all the files are written to ensure that imports are processed correctly (goimports adds named - // aliases for imports where the inferred package name differs from the actual package name, and this can only be - // properly determined after all generated code is written -- see https://github.com/palantir/conjure-go/issues/405). - for _, file := range files { - goFileSrc, err := ptimports.Process(file.absPath, nil, nil) - if err != nil { - return errors.Wrapf(err, "failed to run ptimports on generated Go source for file %s", file.absPath) - } - if err := os.WriteFile(file.absPath, goFileSrc, 0644); err != nil { - return errors.Wrapf(err, "failed to write file") - } - } return nil } diff --git a/vendor/github.com/palantir/conjure-go/v6/conjure/outputs.go b/vendor/github.com/palantir/conjure-go/v6/conjure/outputs.go index 250d3e4b..adcf0ced 100644 --- a/vendor/github.com/palantir/conjure-go/v6/conjure/outputs.go +++ b/vendor/github.com/palantir/conjure-go/v6/conjure/outputs.go @@ -57,10 +57,7 @@ func (f *OutputFile) Render() ([]byte, error) { return nil, errors.Wrapf(err, "failed to generate Go source for file %s", f.absPath) } - goFileSrc, err := ptimports.Process("", buf.Bytes(), &ptimports.Options{ - Refactor: true, - FormatOnly: true, - }) + goFileSrc, err := ptimports.Process("", buf.Bytes(), &ptimports.Options{Refactor: true}) if err != nil { return nil, errors.Wrapf(err, "failed to run ptimports on generated Go source for file %s", f.absPath) } diff --git a/vendor/modules.txt b/vendor/modules.txt index d4c994f4..13388608 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.36.0 +# github.com/palantir/conjure-go/v6 v6.37.0 ## explicit; go 1.19 github.com/palantir/conjure-go/v6/conjure github.com/palantir/conjure-go/v6/conjure-api/conjure/spec