Skip to content

Commit

Permalink
feat: bump go version to 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 committed Mar 18, 2024
1 parent 3fdef61 commit 60d6c4c
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: Setup K3d
uses: nolar/setup-k3d-k3s@v1.0.8
- name: run e2e
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: Running go tests with coverage
env:
GO111MODULE: on
Expand All @@ -36,15 +36,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
version: v1.56.2
Publish: # Pack and publish image to Docker Hub and GitHub Release
runs-on: ubuntu-latest
needs: [Test, Lint]
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
# Get version information
- name: Get version
id: get_version
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22

- run: go build ./...
- run: go vet ./...
Expand All @@ -42,12 +42,12 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
version: v1.56.2
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linters:
- govet
- gofumpt
- bodyclose
- depguard
# - depguard
- dogsled
- dupl
- exportloopref
Expand All @@ -48,7 +48,7 @@ linters:
linters-settings:
gofumpt:
# Select the Go version to target. The default is `1.15`.
lang-version: "1.19"
lang-version: "1.22"
# Choose whether or not to use the extra rules that are disabled
# by default
extra-rules: false
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 AS build
FROM golang:1.22 AS build
COPY / /src
WORKDIR /src
RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build-local-linux
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN_IN_DOCKER+=-w /root/kusion ${KCLVM_BUILDER}
GOFORMATER ?= gofumpt
GOFORMATER_VERSION ?= v0.2.0
GOLINTER ?= golangci-lint
GOLINTER_VERSION ?= v1.52.2
GOLINTER_VERSION ?= v1.56.2
COVER_FILE ?= coverage.out
SOURCE_PATHS ?= ./pkg/...

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module kusionstack.io/kusion

go 1.19
go 1.22

require (
github.com/AlecAivazis/survey/v2 v2.3.4
Expand Down
45 changes: 45 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kusion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func main() {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

command := cmd.NewDefaultKusionctlCommand()

Expand Down
1 change: 0 additions & 1 deletion pkg/scaffold/demo_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func GenDemoProject(dir, name string) error {

return nil
})

if err != nil {
return err
}
Expand Down

0 comments on commit 60d6c4c

Please sign in to comment.