diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 49c9aa9..d75d82a 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -14,10 +14,11 @@ jobs: - uses: actions/checkout@v3 - run: | git fetch --prune --unshallow - - name: Set up Go 1.18 + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version-file: "go.mod" + - name: Install Protoc # this will need to change to v2 when we move to protoc >= 3.20 # protoc version will need to change to minor.patch too @@ -39,10 +40,10 @@ jobs: - uses: actions/checkout@v3 - run: | git fetch --prune --unshallow - - name: Set up Go 1.18 + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version-file: "go.mod" - name: Install Protoc # this will need to change to v2 when we move to protoc >= 3.20 # protoc version will need to change to minor.patch too diff --git a/anyvendor/anyvendor.pb.go b/anyvendor/anyvendor.pb.go index 3fbb566..e45d483 100644 --- a/anyvendor/anyvendor.pb.go +++ b/anyvendor/anyvendor.pb.go @@ -22,11 +22,10 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// Config object used for running anyvendor. The top level config consists of 2 main sections. // -//Config object used for running anyvendor. The top level config consists of 2 main sections. -// -//Local is a set of matchers will be taken directly from the local module, and vendored in. -//Imports is a list of import types which will be run, and then vendored. +// Local is a set of matchers will be taken directly from the local module, and vendored in. +// Imports is a list of import types which will be run, and then vendored. type Config struct { // files to be vendored from current repo Local *Local `protobuf:"bytes,1,opt,name=local,proto3" json:"local,omitempty"` @@ -240,15 +239,14 @@ func (m *Local) GetPatterns() []string { return nil } +// A go mod import represents a set of imports from a go module // -//A go mod import represents a set of imports from a go module -// -//patterns is a set glob matchers to find files in a go module. +// patterns is a set glob matchers to find files in a go module. // -//package is the name of the go module which these should be pulled from. +// package is the name of the go module which these should be pulled from. // -//The GoModImport uses the command `go list -f '{{.Path}}' -m all` to find -//all of the package names +// The GoModImport uses the command `go list -f '{{.Path}}' -m all` to find +// all of the package names type GoModImport struct { Patterns []string `protobuf:"bytes,1,rep,name=patterns,proto3" json:"patterns,omitempty"` Package string `protobuf:"bytes,2,opt,name=package,proto3" json:"package,omitempty"` diff --git a/changelog/v0.2.0/go-124.yaml b/changelog/v0.2.0/go-124.yaml new file mode 100644 index 0000000..4c013b7 --- /dev/null +++ b/changelog/v0.2.0/go-124.yaml @@ -0,0 +1,5 @@ +changelog: + - type: BREAKING_CHANGE + description: "Update Go to 1.24" + issueLink: https://github.com/solo-io/solo-projects/issues/7609 + resolvesIssue: false \ No newline at end of file diff --git a/go.mod b/go.mod index e9f13f5..44914f2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/solo-io/anyvendor -go 1.18 +go 1.24 require ( github.com/envoyproxy/protoc-gen-validate v0.6.1 diff --git a/go.sum b/go.sum index 11c8459..812d7c4 100644 --- a/go.sum +++ b/go.sum @@ -143,6 +143,7 @@ golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= @@ -179,6 +180,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/git/vendor_git.go b/pkg/git/vendor_git.go index af0b967..bf98f5d 100644 --- a/pkg/git/vendor_git.go +++ b/pkg/git/vendor_git.go @@ -63,7 +63,7 @@ func (r *GitRepository) Vendor(cache *GitVendorCache, vendorDir string) error { copiedFileSuffix := filepath.Join(repoRelativePath, cachedFile[len(cachedRepoDir):]) copiedFile := filepath.Join(vendorDir, copiedFileSuffix) if _, err := fileCopier.Copy(cachedFile, copiedFile); err != nil { - return eris.Wrapf(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", + return eris.Wrap(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", err.Error(), cachedFile)) } } diff --git a/pkg/manager/gomod.go b/pkg/manager/gomod.go index d298a85..8c343b2 100644 --- a/pkg/manager/gomod.go +++ b/pkg/manager/gomod.go @@ -175,7 +175,7 @@ func (m *goModFactory) copy(modules []*moduleWithImports) error { localPath := strings.TrimPrefix(vendorFile, m.WorkingDirectory+"/") localFile := filepath.Join(m.WorkingDirectory, anyvendor.DefaultDepDir, mod.module.Path, localPath) if _, err := m.fileCopier.Copy(vendorFile, localFile); err != nil { - return eris.Wrapf(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", + return eris.Wrap(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", err.Error(), vendorFile)) } } @@ -184,7 +184,7 @@ func (m *goModFactory) copy(modules []*moduleWithImports) error { localPath := filepath.Join(mod.module.Path, vendorFile[len(mod.module.Dir):]) localFile := filepath.Join(m.WorkingDirectory, anyvendor.DefaultDepDir, localPath) if _, err := m.fileCopier.Copy(vendorFile, localFile); err != nil { - return eris.Wrapf(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", + return eris.Wrap(err, fmt.Sprintf("Error! %s - unable to copy file %s\n", err.Error(), vendorFile)) } } diff --git a/pkg/manager/protodep.go b/pkg/manager/protodep.go index f69ec53..493fdf8 100644 --- a/pkg/manager/protodep.go +++ b/pkg/manager/protodep.go @@ -7,16 +7,16 @@ import ( ) /* - An internal only interface used to represent the different types of available sources - for non-go vendored files. +An internal only interface used to represent the different types of available sources +for non-go vendored files. */ type depFactory interface { Ensure(ctx context.Context, opts *anyvendor.Config) error } /* - The manager is the external facing object that will be responsible for ensuring - a given anyvendor config, as outlined by the `anyvendor.Config` object. +The manager is the external facing object that will be responsible for ensuring +a given anyvendor config, as outlined by the `anyvendor.Config` object. */ type Manager struct { depFactories []depFactory diff --git a/pkg/modutils/mod.go b/pkg/modutils/mod.go index 07886ad..2518e1d 100644 --- a/pkg/modutils/mod.go +++ b/pkg/modutils/mod.go @@ -22,9 +22,9 @@ var ( ) /* - Returns the current go mod package name from the go.mod file. - Use the function below to get the filename - Ex: github.com/solo-io/solo-kit +Returns the current go mod package name from the go.mod file. +Use the function below to get the filename +Ex: github.com/solo-io/solo-kit */ func GetCurrentModPackageName(module string) (string, error) { f, err := os.Open(module) @@ -45,10 +45,10 @@ func GetCurrentModPackageName(module string) (string, error) { } /* - Returns the current go mod package - Ex: /path/to/solo-kit/go.mod +Returns the current go mod package +Ex: /path/to/solo-kit/go.mod - Will return /dev/null on unix if not in a go.mod package +Will return /dev/null on unix if not in a go.mod package */ func GetCurrentModPackageFile() (string, error) { cmd := exec.Command("go", "env", "GOMOD")