diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 217e00037..ad203ef8f 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22 AS builder +FROM golang:1.24 AS builder ARG BUILD=now ARG REPO=git.frostfs.info/TrueCloudLab/frostfs-s3-gw diff --git a/.forgejo/workflows/builds.yml b/.forgejo/workflows/builds.yml index 7c2bb0468..ebb6bcc1b 100644 --- a/.forgejo/workflows/builds.yml +++ b/.forgejo/workflows/builds.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.22', '1.23' ] + go_versions: [ '1.23', '1.24' ] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml index 81d93dc8a..c12f3c69e 100644 --- a/.forgejo/workflows/tests.yml +++ b/.forgejo/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '1.23' + go-version: '1.24' cache: true - name: Install linters @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.22', '1.23' ] + go_versions: [ '1.23', '1.24' ] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/.golangci.yml b/.golangci.yml index 8916aa624..1c45132ad 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,9 +22,6 @@ linters-settings: # 'default' case is present, even if all enum members aren't listed in the # switch default-signifies-exhaustive: true - govet: - # report about shadowed variables - check-shadowing: false custom: truecloudlab-linters: path: bin/external_linters.so diff --git a/CHANGELOG.md b/CHANGELOG.md index c6a3627d5..2cae6b154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ This document outlines major changes between releases. ## [Unreleased] +- Update Go to 1.23 and linters (#691) ### Fixed - Number of bucket tags increased to 50 (#613) diff --git a/Makefile b/Makefile index dfcef89a2..29dcab433 100755 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ # Common variables REPO ?= $(shell go list -m) VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop") -GO_VERSION ?= 1.22 -LINT_VERSION ?= 1.60.1 -TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 +GO_VERSION ?= 1.23 +LINT_VERSION ?= 1.64.8 +TRUECLOUDLAB_LINT_VERSION ?= 0.0.10 BINDIR = bin METRICS_DUMP_OUT ?= ./metrics-dump.json @@ -152,7 +152,7 @@ lint-install: @@make -C $(TMP_DIR)/linters lib CGO_ENABLED=1 OUT_DIR=$(OUTPUT_LINT_DIR) @rm -rf $(TMP_DIR)/linters @rmdir $(TMP_DIR) 2>/dev/null || true - @CGO_ENABLED=1 GOBIN=$(LINT_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINT_VERSION) + @CGO_ENABLED=1 GOBIN=$(LINT_DIR) go install -trimpath github.com/golangci/golangci-lint/cmd/golangci-lint@v$(LINT_VERSION) # Run linters lint: diff --git a/api/handler/put.go b/api/handler/put.go index c2004e083..5614f44f8 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -153,13 +153,13 @@ func (p *policyCondition) UnmarshalJSON(data []byte) error { } if p.Matching == "content-length-range" { - min, ok := v[1].(float64) - max, ok2 := v[2].(float64) + minR, ok := v[1].(float64) + maxR, ok2 := v[2].(float64) if !ok || !ok2 { return errInvalidCondition } - p.Key = strconv.FormatFloat(min, 'f', 0, 32) - p.Value = strconv.FormatFloat(max, 'f', 0, 32) + p.Key = strconv.FormatFloat(minR, 'f', 0, 32) + p.Value = strconv.FormatFloat(maxR, 'f', 0, 32) } else { key, ok2 := v[1].(string) p.Value, ok = v[2].(string) diff --git a/go.mod b/go.mod index c53f53db2..b6a733ad7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-s3-gw -go 1.22 +go 1.23 require ( git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.1-0.20241022094040-5f956751d48b