diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 739d324cd..2c36e86e2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - uses: golangci/golangci-lint-action@v3 with: @@ -71,7 +71,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 4f2f62502..9cbc61a1d 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure @@ -104,7 +104,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" cache: true - run: go install ./... - run: registry config configurations create local --registry.address='127.0.0.1:8080' --registry.insecure diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d195f10a..8c7b96680 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: echo ::set-output name=version::${GITHUB_REF#refs/tags/} - uses: actions/setup-go@v3 with: - go-version: ^1.18 + go-version: "^1.20" cache: false - uses: goreleaser/goreleaser-action@v4 with: diff --git a/README.md b/README.md index a57d828c0..9c80b7bc2 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ The entry point for the Registry API server itself is The following tools are needed to build this software: -- Go 1.18 (recommended) or later. +- Go 1.20 (recommended) or later. - protoc, the Protocol Buffer Compiler (see [tools/PROTOC-VERSION.sh](/tools/PROTOC-VERSION.sh) for the currently-used version). diff --git a/containers/registry-server/Dockerfile b/containers/registry-server/Dockerfile index e4d10ef2d..0c8b36b3b 100644 --- a/containers/registry-server/Dockerfile +++ b/containers/registry-server/Dockerfile @@ -17,7 +17,7 @@ # Use the official Golang image to create a build artifact. # This is based on Debian and sets the GOPATH to /go. # https://hub.docker.com/_/golang -FROM golang:1.18 as builder +FROM golang:1.20 as builder RUN apt-get update RUN apt-get -y install unzip diff --git a/containers/registry-tools/Dockerfile b/containers/registry-tools/Dockerfile index 55d981316..2be489573 100644 --- a/containers/registry-tools/Dockerfile +++ b/containers/registry-tools/Dockerfile @@ -17,7 +17,7 @@ # Use the official Golang image to create a build artifact. # This is based on Debian and sets the GOPATH to /go. # https://hub.docker.com/_/golang -FROM golang:1.18 as builder +FROM golang:1.20 as builder RUN apt-get update RUN apt-get install unzip diff --git a/deployments/envoy/Dockerfile b/deployments/envoy/Dockerfile index f4c1e0133..cb7d2b0aa 100644 --- a/deployments/envoy/Dockerfile +++ b/deployments/envoy/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. ARG ENVOY_VERSION=v1.20-latest -ARG GO_VERSION=1.18 +ARG GO_VERSION=1.20 FROM golang:${GO_VERSION} as builder diff --git a/go.mod b/go.mod index 204029672..10a549f9e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/apigee/registry -go 1.18 +go 1.20 require ( cloud.google.com/go/longrunning v0.4.1 diff --git a/pkg/config/config.go b/pkg/config/config.go index f8a984fd9..9351c8779 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -19,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -69,7 +68,7 @@ func CreateFlagSet() *pflag.FlagSet { // Configurations returns stored Configurations by name func Configurations() (map[string]Configuration, error) { - files, err := ioutil.ReadDir(Directory) + files, err := os.ReadDir(Directory) if err != nil { return nil, err } @@ -150,7 +149,7 @@ func Activate(name string) error { } f := filepath.Join(Directory, ActivePointerFilename) - return ioutil.WriteFile(f, []byte(name), os.FileMode(0644)) // rw,r,r + return os.WriteFile(f, []byte(name), os.FileMode(0644)) // rw,r,r } // ReadValid reads the specified Configuration, resolves it, and @@ -253,7 +252,7 @@ func Delete(name string) error { // Returns "" if active_config is not found. func ActiveName() (string, error) { f := filepath.Join(Directory, ActivePointerFilename) - bytes, err := ioutil.ReadFile(f) + bytes, err := os.ReadFile(f) if errors.Is(err, os.ErrNotExist) { return "", nil } else if err != nil { diff --git a/pkg/config/configuration_test.go b/pkg/config/configuration_test.go index d5a1aa1b1..32804876c 100644 --- a/pkg/config/configuration_test.go +++ b/pkg/config/configuration_test.go @@ -15,7 +15,6 @@ package config_test import ( - "io/ioutil" "os" "path" "path/filepath" @@ -49,7 +48,7 @@ func TestActiveSettings(t *testing.T) { // missing config file f := filepath.Join(config.Directory, config.ActivePointerFilename) - err = ioutil.WriteFile(f, []byte("missing"), os.FileMode(0644)) // rw,r,r + err = os.WriteFile(f, []byte("missing"), os.FileMode(0644)) // rw,r,r if err != nil { t.Fatal(err) }