Skip to content

Commit

Permalink
Update Golang to 1.23 (#4453)
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Aug 20, 2024
2 parents a3126a5 + 26149a7 commit 83e9484
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: '1.23.x'
- name: Install
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: '1.23.x'
- name: Install
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version: "1.23.x"
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
include:
# Recommended version
- go-version: '1.22.x'
- go-version: '1.23.x'
couchdb-version: '3.3.3'
# More exotic version
- go-version: '1.19.x'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version: "1.23.x"
- name: Checkout code
uses: actions/checkout@v4
- name: Build the binaries
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.os }}
options: -v ${{ github.workspace }}:/build -e GOVERSION=1.22.0
options: -v ${{ github.workspace }}:/build -e GOVERSION=1.23.0
run: |
echo "[safe]" > /root/.gitconfig
echo " directory = /build" >> /root/.gitconfig
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: '1.23.x'
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: scripts/golangci-lint
.PHONY: lint

scripts/golangci-lint: Makefile
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./scripts v1.58.1
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./scripts v1.60.1

## jslint: enforce a consistent code style for Js code
jslint: scripts/node_modules
Expand Down
2 changes: 1 addition & 1 deletion docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ docker run -it --rm --name cozy-stack \
--workdir /app \
-v $(pwd):/app \
-v $(pwd):/go/bin \
golang:1.22 \
golang:1.23 \
go get -v github.com/cozy/cozy-stack
```

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func Setup(cfgFile string) (err error) {
if err := viper.MergeConfig(dest); err != nil {
if _, isParseErr := err.(viper.ConfigParseError); isParseErr {
log.Errorf("Failed to read cozy-stack configurations from %s", cfgFile)
log.Errorf(dest.String())
log.Errorf("%s", dest.String())
return err
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/i18n/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TranslatorHTML(locale, contextName string) func(key string, vars ...interfa
// Translate translates the given key on the specified locale.
func Translate(key, locale, contextName string, vars ...interface{}) string {
if po, ok := translations[contextName+"/"+locale]; ok {
translated := po.Get(key)
translated := po.Get(key) //nolint:govet // key is given by the stack and is safe
if translated != key && translated != "" {
if len(vars) > 0 {
return fmt.Sprintf(translated, vars...)
Expand All @@ -60,7 +60,7 @@ func Translate(key, locale, contextName string, vars ...interface{}) string {
}
}
if po, ok := translations[locale]; ok {
translated := po.Get(key)
translated := po.Get(key) //nolint:govet // key is given by the stack and is safe
if translated != key && translated != "" {
if len(vars) > 0 {
return fmt.Sprintf(translated, vars...)
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/cozy-app-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


# Multi-stage image: this step builds cozy-stack (and mailhog)
FROM golang:1.22-bullseye as build
FROM golang:1.23-bullseye as build
WORKDIR /app

# MailHog
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


# Multi-stage image: this step builds cozy-stack
FROM golang:1.22-bookworm as build
FROM golang:1.23-bookworm as build
WORKDIR /app

# Use docker layer caching to avoid redownloading go modules if the code has
Expand Down
2 changes: 1 addition & 1 deletion scripts/packaging/installrequirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

GOVERSION="${GOVERSION:-1.22.4}"
GOVERSION="${GOVERSION:-1.23.0}"

cd "$(dirname $0)/../.."
if [ -f debian/changelog ]; then
Expand Down
4 changes: 2 additions & 2 deletions worker/mails/mail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ func mailServer(t *testing.T, serverString string, clientStrings []string, expec
readdata := false
readhead := false
for i := 0; i < len(data) && data[i] != ""; i++ {
_ = tc.PrintfLine(data[i])
_ = tc.PrintfLine("%s", data[i])
for len(data[i]) >= 4 && data[i][3] == '-' {
i++
_ = tc.PrintfLine(data[i])
_ = tc.PrintfLine("%s", data[i])
}
if data[i] == "221 Goodbye" {
return
Expand Down

0 comments on commit 83e9484

Please sign in to comment.