Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go to v1.20 #73

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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