Skip to content

Commit

Permalink
Merge pull request #73 from minamijoyo/update-go-to-v1.20
Browse files Browse the repository at this point in the history
Update Go to v1.20
  • Loading branch information
minamijoyo authored Apr 18, 2023
2 parents 8b121e6 + 1994768 commit 09b3bd4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
version: v1.52.2
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.3
1.20
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/minamijoyo/hcledit

go 1.18
go 1.20

require (
github.com/hashicorp/hcl/v2 v2.12.0
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"

Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 09b3bd4

Please sign in to comment.