Skip to content

Commit fe8f991

Browse files
Merge pull request #373 from MichaelEischer/update-ci
Require Go 1.24 and sync CI configuration with restic
2 parents 654fa16 + 441efb0 commit fe8f991

File tree

8 files changed

+55
-54
lines changed

8 files changed

+55
-54
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ updates:
55
directory: "/" # Location of package manifests
66
schedule:
77
interval: "weekly"
8+
groups:
9+
golang-x-deps:
10+
patterns:
11+
- "golang.org/x/*"
812

913
# Dependencies listed in .github/workflows/*.yml
1014
- package-ecosystem: "github-actions"

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
env:
16-
latest_go: "1.24.x"
16+
latest_go: "1.25.x"
1717
GO111MODULE: on
1818

1919
jobs:
@@ -22,17 +22,17 @@ jobs:
2222
matrix:
2323
include:
2424
- job_name: Linux
25-
go: 1.24.x
25+
go: 1.25.x
2626
os: ubuntu-latest
2727
check_changelog: true
2828

2929
- job_name: Linux (race)
30-
go: 1.24.x
30+
go: 1.25.x
3131
os: ubuntu-latest
3232
test_opts: "-race"
3333

3434
- job_name: Linux
35-
go: 1.23.x
35+
go: 1.24.x
3636
os: ubuntu-latest
3737

3838
name: ${{ matrix.job_name }} Go ${{ matrix.go }}
@@ -43,7 +43,7 @@ jobs:
4343

4444
steps:
4545
- name: Check out code
46-
uses: actions/checkout@v5
46+
uses: actions/checkout@v6
4747

4848
- name: Set up Go ${{ matrix.go }}
4949
uses: actions/setup-go@v6
@@ -78,18 +78,18 @@ jobs:
7878
checks: write
7979
steps:
8080
- name: Check out code
81-
uses: actions/checkout@v5
81+
uses: actions/checkout@v6
8282

8383
- name: Set up Go ${{ env.latest_go }}
8484
uses: actions/setup-go@v6
8585
with:
8686
go-version: ${{ env.latest_go }}
8787

8888
- name: golangci-lint
89-
uses: golangci/golangci-lint-action@v6
89+
uses: golangci/golangci-lint-action@v9
9090
with:
9191
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
92-
version: v1.64.8
92+
version: v2.4.0
9393
args: --verbose --timeout 5m
9494

9595
# only run golangci-lint for pull requests, otherwise ALL hints get

.golangci.yml

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,47 @@
1-
# This is the configuration for golangci-lint for the restic project.
2-
#
3-
# A sample config with all settings is here:
4-
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
5-
1+
version: "2"
62
linters:
73
# only enable the linters listed below
8-
disable-all: true
4+
default: none
95
enable:
6+
- asciicheck
7+
# ensure that http response bodies are closed
8+
- bodyclose
9+
- copyloopvar
1010
# make sure all errors returned by functions are handled
1111
- errcheck
12-
13-
# show how code can be simplified
14-
- gosimple
15-
16-
# make sure code is formatted
17-
- gofmt
18-
1912
# examine code and report suspicious constructs, such as Printf calls whose
2013
# arguments do not align with the format string
2114
- govet
22-
23-
# make sure names and comments are used according to the conventions
24-
- revive
25-
15+
# consistent imports
16+
- importas
2617
# detect when assignments to existing variables are not used
2718
- ineffassign
28-
19+
- nolintlint
20+
# make sure names and comments are used according to the conventions
21+
- revive
2922
# run static analysis and find errors
3023
- staticcheck
31-
3224
# find unused variables, functions, structs, types, etc.
3325
- unused
34-
35-
# parse and typecheck code
36-
- typecheck
37-
38-
# ensure that http response bodies are closed
39-
- bodyclose
40-
41-
- importas
42-
43-
issues:
44-
# don't use the default exclude rules, this hides (among others) ignored
45-
# errors from Close() calls
46-
exclude-use-default: false
47-
48-
# list of things to not warn about
49-
exclude:
50-
# revive: do not warn about missing comments for exported stuff
51-
- exported (function|method|var|type|const) .* should have comment or be unexported
52-
# revive: ignore constants in all caps
53-
- don't use ALL_CAPS in Go names; use CamelCase
54-
# revive: lots of packages don't have such a comment
55-
- "package-comments: should have a package comment"
56-
- "redefines-builtin-id:"
26+
exclusions:
27+
rules:
28+
- path: (.+)\.go$
29+
text: exported (function|method|var|type|const) .* should have comment or be unexported
30+
- path: (.+)\.go$
31+
text: don't use ALL_CAPS in Go names; use CamelCase
32+
- path: (.+)\.go$
33+
text: "package-comments: should have a package comment"
34+
- path: (.+)\.go$
35+
text: "redefines-builtin-id:"
36+
paths:
37+
- third_party$
38+
- builtin$
39+
- examples$
40+
formatters:
41+
enable:
42+
- gofmt
43+
exclusions:
44+
paths:
45+
- third_party$
46+
- builtin$
47+
- examples$

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Rest Server is a high performance HTTP server that implements restic's [REST bac
1111

1212
## Requirements
1313

14-
Rest Server requires Go 1.23 or higher to build. The only tested compiler is the official Go compiler.
14+
Rest Server requires Go 1.24 or higher to build. The only tested compiler is the official Go compiler.
1515

1616
The required version of restic backup client to use with `rest-server` is [v0.7.1](https://github.com/restic/restic/releases/tag/v0.7.1) or higher.
1717

build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var config = Config{
5858
Namespace: "github.com/restic/rest-server", // subdir of GOPATH, e.g. "github.com/foo/bar"
5959
Main: "github.com/restic/rest-server/cmd/rest-server", // package name for the main package
6060
Tests: []string{"./..."}, // tests to run
61-
MinVersion: GoVersion{Major: 1, Minor: 23, Patch: 0}, // minimum Go version supported
61+
MinVersion: GoVersion{Major: 1, Minor: 24, Patch: 0}, // minimum Go version supported
6262
}
6363

6464
// Config configures the build.

changelog/unreleased/pull-373

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Change: Update dependencies and require Go 1.24 or newer
2+
3+
All dependencies have been updated. Rest-server now requires Go 1.24 or newer
4+
to build.
5+
6+
https://github.com/restic/rest-server/pull/373

cmd/rest-server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (app *restServerApp) runRoot(_ *cobra.Command, _ []string) error {
196196
case "1.3":
197197
tlscfg.MinVersion = tls.VersionTLS13
198198
default:
199-
return fmt.Errorf("Unsupported TLS min version: %s. Allowed versions are 1.2 or 1.3", app.Server.TLSMinVer)
199+
return fmt.Errorf("unsupported TLS min version: %s. Allowed versions are 1.2 or 1.3", app.Server.TLSMinVer)
200200
}
201201

202202
srv := &http.Server{

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/restic/rest-server
22

3-
go 1.23.0
3+
go 1.24.0
44

55
require (
66
github.com/coreos/go-systemd/v22 v22.5.0

0 commit comments

Comments
 (0)