Skip to content

Commit

Permalink
feat: Bump go to 1.23 (#321)
Browse files Browse the repository at this point in the history
* feat: Bump go to 1.23

* fix: golangci config

* fix: linter warning
  • Loading branch information
obalunenko authored Sep 5, 2024
1 parent ffc575f commit ce6e359
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Learn more about CodeQL language support at https://git.io/codeql-language-support
language: [ 'go' ]
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
max-parallel: 3
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Build
steps:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
max-parallel: 2
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Run Tests
steps:
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
max-parallel: 2
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Run linters
steps:
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
max-parallel: 1
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Quality reports
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
max-parallel: 2
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Build
steps:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
max-parallel: 2
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Regression tests
steps:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
max-parallel: 1
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Lint
steps:
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
max-parallel: 1
matrix:
os: [ 'ubuntu-22.04' ]
go-version: [1.21]
go-version: [1.23]
runs-on: ${{ matrix.os }}
name: Release
steps:
Expand Down
10 changes: 5 additions & 5 deletions .golangci.pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ linters-settings:
arguments: [ [ "call-chain", "loop", "method-call", "recover", "return" ] ]

issues:
exclude-files:
- \.pb\.go$
exclude-dirs:
- vendor
exclude-use-default: false
exclude:
# for "public interface + private struct implementation" cases only!
Expand Down Expand Up @@ -97,16 +101,12 @@ issues:
run:
issues-exit-code: 1
tests: true
skip-dirs:
- vendor/
skip-files:
- \.pb\.go$

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
format: github-actions
formats: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

release:
github:
owner: obalunenko
Expand Down Expand Up @@ -79,7 +81,7 @@ checksum:
name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt"

snapshot:
name_template: SNAPSHOT-{{ .Commit }}
version_template: SNAPSHOT-{{ .Commit }}

changelog:
sort: asc
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
SHELL := env VERSION=$(VERSION) $(SHELL)
VERSION ?= $(shell git describe --tags $(git rev-list --tags --max-count=1))

GOVERSION:=1.21
GOVERSION:=1.23

APP_NAME?=aoc-cli
SHELL := env APP_NAME=$(APP_NAME) $(SHELL)

GOTOOLS_IMAGE_TAG?=v0.12.1
SHELL := env GOTOOLS_IMAGE_TAG=$(GOTOOLS_IMAGE_TAG) $(SHELL)

COMPOSE_TOOLS_FILE=deployments/docker-compose/go-tools-docker-compose.yml
Expand Down
2 changes: 1 addition & 1 deletion build/docker/go-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM ghcr.io/obalunenko/go-tools:v1.4.4 AS builder
FROM ghcr.io/obalunenko/go-tools:v1.5.1 AS builder

CMD ["/bin/sh", "-c", ""]
2 changes: 0 additions & 2 deletions deployments/docker-compose/go-tools-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
tools:
build:
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 github.com/obalunenko/advent-of-code

go 1.21
go 1.23
toolchain go1.22.5

require (
Expand Down
8 changes: 3 additions & 5 deletions internal/puzzles/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ func printTable(w io.Writer, table [][]string) error {
case 0:
_, err = fmt.Fprintf(w, "\n")
case 1:
_, err = fmt.Fprintf(writer, "\t"+strings.Join(line, "\t")+"\t\n")
_, err = fmt.Fprintf(writer, "\t%s", strings.Join(line, "\t")+"\t\n")
default:
_, err = fmt.Fprintf(writer, "\t "+strings.Join(line, "\t")+"\t\n")
_, err = fmt.Fprintf(writer, "\t %s", strings.Join(line, "\t")+"\t\n")
}

if err != nil {
if err != nil {
return fmt.Errorf("fprintln: %w", err)
}
return fmt.Errorf("fprintln: %w", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/linting/golangci-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ checkInstalled golangci-lint

echo "Linting..."

golangci-lint run --out-format=github-actions --no-config --disable-all -E govet
golangci-lint run --out-format=colored-line-number --no-config --disable-all -E govet
golangci-lint run --config .golangci.pipe.yml

echo "${SCRIPT_NAME} done."

0 comments on commit ce6e359

Please sign in to comment.