diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a49285d..6b7a1a8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,4 +22,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.46.2 + version: v1.52.2 diff --git a/.go-version b/.go-version index b9fb27a..5fb5a6b 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.18.3 +1.20 diff --git a/Dockerfile b/Dockerfile index 991346a..4fd0995 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # build -FROM golang:1.18.3-alpine3.16 AS builder +FROM golang:1.20-alpine3.17 AS builder RUN apk --no-cache add make git WORKDIR /work @@ -13,7 +13,7 @@ RUN make build # The linux binary for hub can not run on alpine. # So we need to build it from source. # https://github.com/github/hub/issues/1818 -FROM golang:1.18.3-alpine3.16 AS hub +FROM golang:1.20-alpine3.17 AS hub RUN apk add --no-cache bash git RUN git clone https://github.com/github/hub /work WORKDIR /work @@ -22,7 +22,7 @@ RUN ./script/build -o bin/hub # runtime # Note: Required Tools for Primary Containers on CircleCI # https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers -FROM alpine:3.16 +FROM alpine:3.17 RUN apk --no-cache add bash git openssh-client tar gzip ca-certificates COPY --from=builder /work/bin/hcledit /usr/local/bin/ COPY --from=hub /work/bin/hub /usr/local/bin/ diff --git a/README.md b/README.md index 770a489..62f826d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ https://github.com/minamijoyo/hcledit/releases ### Source -If you have Go 1.18+ development environment: +If you have Go 1.20+ development environment: ``` $ git clone https://github.com/minamijoyo/hcledit diff --git a/cmd/version.go b/cmd/version.go index d0296be..2f93a89 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -25,7 +25,7 @@ func newVersionCmd() *cobra.Command { return cmd } -func runVersionCmd(cmd *cobra.Command, args []string) error { +func runVersionCmd(cmd *cobra.Command, _ []string) error { _, err := fmt.Fprintln(cmd.OutOrStdout(), Version) return err } diff --git a/go.mod b/go.mod index 39eed56..0386f49 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/minamijoyo/hcledit -go 1.18 +go 1.20 require ( github.com/hashicorp/hcl/v2 v2.12.0 diff --git a/main.go b/main.go index ad954b9..7be1db2 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,6 @@ package main import ( "fmt" "io" - "io/ioutil" "log" "os" @@ -25,7 +24,7 @@ func logOutput() io.Writer { minLevel := os.Getenv("HCLEDIT_LOG") // default log writer is null device. - writer := ioutil.Discard + writer := io.Discard if minLevel != "" { writer = os.Stderr } diff --git a/main_test.go b/main_test.go index d65ac08..2af34cc 100644 --- a/main_test.go +++ b/main_test.go @@ -154,7 +154,7 @@ func argsToEnv(args []string) []string { func envToArgs(env []string) []string { var envvars []string - for _, kv := range os.Environ() { + for _, kv := range env { if strings.HasPrefix(kv, VarRunMainForTestingArgPrefix) { envvars = append(envvars, kv) }