Skip to content

Commit 796c18f

Browse files
authored
(MAINT) Rev go to 1.19 and fix ensuing problems. (#51)
1 parent 570200a commit 796c18f

File tree

10 files changed

+131
-555
lines changed

10 files changed

+131
-555
lines changed

.github/workflows/code-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- name: Set up Go environment
1515
uses: actions/setup-go@v4
1616
with:
17-
go-version: 1.16
17+
go-version: 1.19
1818
- name: Run linters
1919
uses: golangci/golangci-lint-action@v3
2020
with:
2121
args: "--timeout=3m --verbose"
22-
version: v1.49
22+
version: v1.55.2

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go environment
1515
uses: actions/setup-go@v4
1616
with:
17-
go-version: 1.16
17+
go-version: 1.19
1818
- name: Run unit tests
1919
run: |
2020
make test

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ linters:
2121
- varcheck # deprecated
2222
- varnamelen # disallows short variable names even if they are appropriate
2323
- wsl # too aggressive
24+
- depguard
2425

2526
linters-settings:
2627
funlen:

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ COMMIT=$(shell git describe --always)
22
NOW=$(shell date +'%Y-%m-%d_%T')
33
TEST_SERVICE=test-generated-service
44

5-
all: lint test test-generated-service build
5+
all: lint test build test-generated-service
66

77
# install development tools
88
PHONY+= install-tools
@@ -46,6 +46,8 @@ test-generated-service:
4646
@echo "$(OK_COLOR)==>Testing generated service.$(NO_COLOR)"
4747
@mkdir -p $(PWD)/$(TEST_SERVICE)
4848
@go run -ldflags "-X main.name=$(TEST_SERVICE) -X main.serviceDir=$(PWD)/$(TEST_SERVICE) -X main.listenAddress=:8888 -X main.listenPort=8888" cmd/service-generator/main.go
49+
@go mod tidy
50+
@go get github.com/gin-gonic/gin
4951
@cd $(PWD)/$(TEST_SERVICE);go test ./...
5052
@rm -rf $(PWD)/$(TEST_SERVICE)
5153

cmd/cert-generator/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,29 @@ func main() {
6767
}
6868

6969
if generateCAFiles != nil && *generateCAFiles {
70-
err = os.WriteFile(fmt.Sprint(filepath.Join(filepath.Clean(*directory), "ca.crt")), CAKeyPair.Certificate,
70+
err = os.WriteFile(filepath.Join(filepath.Clean(*directory), "ca.crt"), CAKeyPair.Certificate,
7171
fileModeUserReadWriteOnly)
7272
if err != nil {
7373
fmt.Printf("Failed to write CA certificate file to disk :%s", err)
7474
os.Exit(errorExitCode)
7575
}
7676

77-
err = os.WriteFile(fmt.Sprint(filepath.Join(filepath.Clean(*directory), "ca.key")), CAKeyPair.PrivateKey,
77+
err = os.WriteFile(filepath.Join(filepath.Clean(*directory), "ca.key"), CAKeyPair.PrivateKey,
7878
fileModeUserReadWriteOnly)
7979
if err != nil {
8080
fmt.Printf("Failed to write CA key file to disk: %s.", err)
8181
os.Exit(errorExitCode)
8282
}
8383
}
8484

85-
err = os.WriteFile(fmt.Sprint(filepath.Join(filepath.Clean(*directory), "tls.crt")), certKeyPair.Certificate,
85+
err = os.WriteFile(filepath.Join(filepath.Clean(*directory), "tls.crt"), certKeyPair.Certificate,
8686
fileModeUserReadWriteOnly)
8787
if err != nil {
8888
fmt.Printf("Failed to write TLS cert file to disk: %s.", err)
8989
os.Exit(errorExitCode)
9090
}
9191

92-
err = os.WriteFile(fmt.Sprint(filepath.Join(filepath.Clean(*directory), "tls.key")), certKeyPair.PrivateKey,
92+
err = os.WriteFile(filepath.Join(filepath.Clean(*directory), "tls.key"), certKeyPair.PrivateKey,
9393
fileModeUserReadWriteOnly)
9494
if err != nil {
9595
fmt.Printf("Failed to write TLS key file to disk: %s.", err)

go.mod

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,65 @@
11
module github.com/puppetlabs/go-libs
22

3-
go 1.16
3+
go 1.19
44

55
require (
66
github.com/cnjack/throttle v0.0.0-20160727064406-525175b56e18
7-
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
87
github.com/gin-contrib/cors v1.4.0
9-
github.com/gin-gonic/gin v1.8.1
10-
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect
8+
github.com/gin-gonic/gin v1.9.1
119
github.com/imdario/mergo v0.3.15
1210
github.com/mitchellh/mapstructure v1.5.0
1311
github.com/prometheus/client_golang v1.14.0
14-
github.com/sirupsen/logrus v1.9.0
12+
github.com/sirupsen/logrus v1.9.3
1513
github.com/spf13/viper v1.14.0
1614
github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f
1715
gotest.tools v2.2.0+incompatible
1816
)
17+
18+
require (
19+
github.com/beorn7/perks v1.0.1 // indirect
20+
github.com/bytedance/sonic v1.9.1 // indirect
21+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
22+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
23+
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
24+
github.com/fsnotify/fsnotify v1.6.0 // indirect
25+
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
26+
github.com/gin-contrib/sse v0.1.0 // indirect
27+
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect
28+
github.com/go-playground/locales v0.14.1 // indirect
29+
github.com/go-playground/universal-translator v0.18.1 // indirect
30+
github.com/go-playground/validator/v10 v10.14.0 // indirect
31+
github.com/goccy/go-json v0.10.2 // indirect
32+
github.com/golang/protobuf v1.5.2 // indirect
33+
github.com/google/go-cmp v0.5.9 // indirect
34+
github.com/hashicorp/hcl v1.0.0 // indirect
35+
github.com/json-iterator/go v1.1.12 // indirect
36+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
37+
github.com/leodido/go-urn v1.2.4 // indirect
38+
github.com/magiconair/properties v1.8.6 // indirect
39+
github.com/mattn/go-isatty v0.0.19 // indirect
40+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
41+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
42+
github.com/modern-go/reflect2 v1.0.2 // indirect
43+
github.com/pelletier/go-toml v1.9.5 // indirect
44+
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
45+
github.com/pkg/errors v0.9.1 // indirect
46+
github.com/prometheus/client_model v0.3.0 // indirect
47+
github.com/prometheus/common v0.37.0 // indirect
48+
github.com/prometheus/procfs v0.8.0 // indirect
49+
github.com/spf13/afero v1.9.2 // indirect
50+
github.com/spf13/cast v1.5.0 // indirect
51+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
52+
github.com/spf13/pflag v1.0.5 // indirect
53+
github.com/subosito/gotenv v1.4.1 // indirect
54+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
55+
github.com/ugorji/go/codec v1.2.11 // indirect
56+
golang.org/x/arch v0.3.0 // indirect
57+
golang.org/x/crypto v0.9.0 // indirect
58+
golang.org/x/net v0.10.0 // indirect
59+
golang.org/x/sys v0.8.0 // indirect
60+
golang.org/x/text v0.9.0 // indirect
61+
google.golang.org/protobuf v1.30.0 // indirect
62+
gopkg.in/ini.v1 v1.67.0 // indirect
63+
gopkg.in/yaml.v2 v2.4.0 // indirect
64+
gopkg.in/yaml.v3 v3.0.1 // indirect
65+
)

0 commit comments

Comments
 (0)