Skip to content

Commit 8b70b6a

Browse files
gwleclercclaude
andcommitted
chore(backend): modernize to Go 1.26 and drop unmaintained deps
Backend/toolchain modernization with the mock format and HTTP/CLI API kept byte-identical (guarded by new golden serialization tests + the venom suite). - go 1.15 -> 1.26; io/ioutil -> io; rand.Seed -> math/rand/v2 - drop facebookgo/grace -> stdlib graceful shutdown (signal.NotifyContext + http.Server.Shutdown + errgroup), TLS preserved (SIGHUP restart dropped) - drop namsral/flag -> stdlib flag (flag names + SMOCKER_* env preserved) - drop logrus -> log/slog - drop teris-io/shortid -> zero-dep crypto/rand base62 id (server/types/id.go) - bump echo v4.15, sprig v3.3, objx v0.5, smarty/assertions v1.16, gopher-lua, gopher-luar, yaml.v3 v3.0.1 (goccy evaluated, rejected: alters output) - golangci-lint config v1 -> v2 (Makefile pin 2.12.2), lint clean - Dockerfile GO_VERSION 1.26 - add golden serialization tests locking the exact YAML/JSON mock format Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5b70e8d commit 8b70b6a

36 files changed

Lines changed: 2122 additions & 295 deletions

.golangci.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
1-
linters-settings:
2-
lll:
3-
line-length: 150
1+
version: "2"
42

5-
issues:
6-
exclude-rules:
7-
- text: "exported type .* should have comment or be unexported"
8-
linters:
9-
- go-lint
3+
linters:
4+
default: standard # errcheck, govet, ineffassign, staticcheck, unused
5+
enable:
6+
- lll
7+
- misspell
8+
settings:
9+
lll:
10+
line-length: 150
11+
staticcheck:
12+
checks:
13+
- all
14+
# ST1005: error strings should not be capitalized. Several validation errors are
15+
# returned verbatim over the API (e.g. mock validation messages), so their exact,
16+
# historically-capitalized wording is part of the observable contract and must not change.
17+
- -ST1005
18+
# ST1003 / ST1012: identifier naming conventions (e.g. Json vs JSON, ErrFoo error vars).
19+
# These are long-standing internal identifiers; renaming them is pure churn with no
20+
# effect on the mock format or HTTP API, so the existing names are kept for stability.
21+
- -ST1003
22+
- -ST1012
23+
exclusions:
24+
generated: lax
25+
paths:
26+
# node_modules ships a stray flatted/*.go; build is generated output. Neither is our code.
27+
- node_modules
28+
- build
29+
presets:
30+
- comments
31+
- std-error-handling
32+
33+
formatters:
34+
enable:
35+
- gofmt
36+
- goimports

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.22
1+
ARG GO_VERSION=1.26
22
FROM golang:${GO_VERSION}-alpine AS build-backend
33
RUN apk add --no-cache make
44
ARG VERSION=snapshot

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ REFLEX=$(GOPATH)/bin/reflex
3434
$(REFLEX):
3535
go install github.com/cespare/reflex@latest
3636

37-
GOLANGCILINTVERSION:=1.64.8
37+
GOLANGCILINTVERSION:=2.12.2
3838
GOLANGCILINT=$(GOPATH)/bin/golangci-lint
3939
$(GOLANGCILINT):
4040
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v$(GOLANGCILINTVERSION)

go.mod

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
module github.com/smocker-dev/smocker
22

3-
go 1.15
3+
go 1.26
44

55
require (
6-
github.com/Masterminds/sprig/v3 v3.2.2
7-
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
8-
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
9-
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 // indirect
10-
github.com/facebookgo/grace v0.0.0-20180706040059-75cf19382434
11-
github.com/facebookgo/httpdown v0.0.0-20180706035922-5979d39b15c2 // indirect
12-
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
13-
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
14-
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
15-
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
16-
github.com/kr/pretty v0.1.0 // indirect
17-
github.com/labstack/echo/v4 v4.7.0
18-
github.com/layeh/gopher-json v0.0.0-20190114024228-97fed8db8427
19-
github.com/mattn/go-colorable v0.1.12 // indirect
20-
github.com/mitchellh/mapstructure v1.1.2 // indirect
21-
github.com/mitchellh/reflectwalk v1.0.1 // indirect
22-
github.com/namsral/flag v1.7.4-pre
23-
github.com/sirupsen/logrus v1.4.2
24-
github.com/smartystreets/assertions v1.0.1
25-
github.com/stretchr/objx v0.2.0
26-
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
6+
github.com/Masterminds/sprig/v3 v3.3.0
7+
github.com/labstack/echo/v4 v4.15.4
8+
github.com/smarty/assertions v1.16.0
9+
github.com/stretchr/objx v0.5.3
2710
github.com/yuin/gluamapper v0.0.0-20150323120927-d836955830e7
28-
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb
29-
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
30-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
31-
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
32-
golang.org/x/sys v0.0.0-20220307203707-22a9840ba4d7 // indirect
11+
github.com/yuin/gopher-lua v1.1.2
12+
golang.org/x/sync v0.21.0
13+
gopkg.in/yaml.v3 v3.0.1
14+
layeh.com/gopher-json v0.0.0-20201124131017-552bb3c4c3bf
15+
layeh.com/gopher-luar v1.0.11
16+
)
17+
18+
require (
19+
dario.cat/mergo v1.0.1 // indirect
20+
github.com/Masterminds/goutils v1.1.1 // indirect
21+
github.com/Masterminds/semver/v3 v3.3.0 // indirect
22+
github.com/google/uuid v1.6.0 // indirect
23+
github.com/huandu/xstrings v1.5.0 // indirect
24+
github.com/labstack/gommon v0.5.0 // indirect
25+
github.com/mattn/go-colorable v0.1.15 // indirect
26+
github.com/mattn/go-isatty v0.0.22 // indirect
27+
github.com/mitchellh/copystructure v1.2.0 // indirect
28+
github.com/mitchellh/mapstructure v1.1.2 // indirect
29+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
30+
github.com/shopspring/decimal v1.4.0 // indirect
31+
github.com/spf13/cast v1.7.0 // indirect
32+
github.com/valyala/bytebufferpool v1.0.0 // indirect
33+
github.com/valyala/fasttemplate v1.2.2 // indirect
34+
golang.org/x/crypto v0.53.0 // indirect
35+
golang.org/x/net v0.56.0 // indirect
36+
golang.org/x/sys v0.46.0 // indirect
37+
golang.org/x/text v0.38.0 // indirect
38+
golang.org/x/time v0.15.0 // indirect
3339
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
34-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
35-
layeh.com/gopher-luar v1.0.7
3640
)

0 commit comments

Comments
 (0)