Skip to content

Commit 18da892

Browse files
authored
Merge pull request #26 from Icinga/dep-bump
Update dependencies and gofmt code
2 parents 9600081 + 6b6fddf commit 18da892

File tree

9 files changed

+227
-940
lines changed

9 files changed

+227
-940
lines changed

.github/workflows/go.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ jobs:
1010
fmt:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-go@v2
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
1515
with:
16-
go-version: '^1.16'
16+
go-version: stable
1717
- name: go fmt
1818
run: test -z "$(gofmt -d . | tee /dev/stderr)"
1919

2020
vet:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v2
24-
- uses: actions/setup-go@v2
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-go@v5
2525
with:
26-
go-version: '^1.16'
26+
go-version: stable
2727
- name: go vet
2828
run: go vet ./...
2929

3030
test:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-go@v2
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-go@v5
3535
with:
36-
go-version: '^1.16'
36+
go-version: stable
3737
- name: go test
3838
run: go test ./...

go.mod

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,34 @@ go 1.16
44

55
require (
66
github.com/Icinga/go-libs v0.0.0-20220420130327-ef58ad52edd8
7-
github.com/Microsoft/go-winio v0.5.0 // indirect
8-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
9-
github.com/containerd/containerd v1.5.5 // indirect
10-
github.com/docker/docker v20.10.8+incompatible
7+
github.com/Microsoft/go-winio v0.6.1 // indirect
8+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
9+
github.com/distribution/reference v0.5.0 // indirect
10+
github.com/docker/distribution v2.8.3+incompatible // indirect
11+
github.com/docker/docker v24.0.7+incompatible
1112
github.com/docker/go-connections v0.4.0 // indirect
12-
github.com/go-redis/redis/v8 v8.11.3
13-
github.com/go-sql-driver/mysql v1.6.0
14-
github.com/gorilla/mux v1.8.0 // indirect
15-
github.com/lib/pq v1.10.4
16-
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
13+
github.com/docker/go-units v0.5.0 // indirect
14+
github.com/fsnotify/fsnotify v1.6.0 // indirect
15+
github.com/go-redis/redis/v8 v8.11.5
16+
github.com/go-sql-driver/mysql v1.7.1
17+
github.com/gogo/protobuf v1.3.2 // indirect
18+
github.com/google/go-cmp v0.6.0 // indirect
19+
github.com/kr/pretty v0.3.1 // indirect
20+
github.com/lib/pq v1.10.9
21+
github.com/mattn/go-sqlite3 v1.14.15 // indirect
22+
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
1723
github.com/morikuni/aec v1.0.0 // indirect
18-
github.com/stretchr/testify v1.7.0
19-
go.uber.org/atomic v1.9.0 // indirect
20-
go.uber.org/multierr v1.7.0 // indirect
21-
go.uber.org/zap v1.19.0
22-
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
23-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
24-
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
25-
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
26-
google.golang.org/genproto v0.0.0-20210824181836-a4879c3d0e89 // indirect
24+
github.com/onsi/gomega v1.24.2 // indirect
25+
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
26+
github.com/rogpeppe/go-internal v1.10.0 // indirect
27+
github.com/stretchr/testify v1.8.4
28+
go.uber.org/goleak v1.2.1 // indirect
29+
go.uber.org/multierr v1.11.0 // indirect
30+
go.uber.org/zap v1.26.0
31+
golang.org/x/sync v0.6.0
32+
golang.org/x/sys v0.16.0 // indirect
33+
golang.org/x/time v0.3.0 // indirect
34+
golang.org/x/tools v0.16.1 // indirect
35+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
36+
gotest.tools/v3 v3.5.0 // indirect
2737
)

go.sum

Lines changed: 167 additions & 889 deletions
Large diffs are not rendered by default.

internal/services/icinga2/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (i *dockerCreator) CreateIcinga2(name string) services.Icinga2Base {
127127
func (i *dockerCreator) Cleanup() {
128128
i.runningMutex.Lock()
129129
nodes := make([]*dockerInstance, 0, len(i.running))
130-
for n, _ := range i.running {
130+
for n := range i.running {
131131
nodes = append(nodes, n)
132132
}
133133
i.runningMutex.Unlock()

internal/services/icingadb/docker_binary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (i *dockerBinaryCreator) CreateIcingaDb(
152152
func (i *dockerBinaryCreator) Cleanup() {
153153
i.runningMutex.Lock()
154154
instances := make([]*dockerBinaryInstance, 0, len(i.running))
155-
for inst, _ := range i.running {
155+
for inst := range i.running {
156156
instances = append(instances, inst)
157157
}
158158
i.runningMutex.Unlock()

internal/services/redis/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (r *dockerCreator) CreateRedisServer() services.RedisServerBase {
138138
func (r *dockerCreator) Cleanup() {
139139
r.runningMutex.Lock()
140140
servers := make([]*dockerServer, 0, len(r.running))
141-
for s, _ := range r.running {
141+
for s := range r.running {
142142
servers = append(servers, s)
143143
}
144144
r.runningMutex.Unlock()

it.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
// the Docker API to start and stop containers locally as required by the tests.
55
//
66
// The following environment variables are used by icinga-testing:
7-
// - ICINGA_TESTING_ICINGA2_IMAGE: Icinga 2 container image to use (default: "icinga/icinga2:master")
8-
// - ICINGA_TESTING_MYSQL_IMAGE: MySQL/MariaDB container image to use (default: "mysql:latest")
9-
// - ICINGA_TESTING_PGSQL_IMAGE: PostgreSQL container image to use (default: "postgres:latest")
10-
// - ICINGA_TESTING_REDIS_IMAGE: Redis container image to use (default: "redis:latest")
11-
// - ICINGA_TESTING_REDIS_MONITOR: If set to "1", log all Redis commands to the debug log using redis-cli monitor
12-
// - ICINGA_TESTING_ICINGADB_BINARY: Path to the Icinga DB binary to test. It will run in a container and therefore
13-
// must be compiled using CGO_ENABLED=0
14-
// - ICINGA_TESTING_ICINGADB_SCHEMA_MYSQL: Path to the full Icinga DB schema file for MySQL/MariaDB
15-
// - ICINGA_TESTING_ICINGADB_SCHEMA_PGSQL: Path to the full Icinga DB schema file for PostgreSQL
7+
// - ICINGA_TESTING_ICINGA2_IMAGE: Icinga 2 container image to use (default: "icinga/icinga2:master")
8+
// - ICINGA_TESTING_MYSQL_IMAGE: MySQL/MariaDB container image to use (default: "mysql:latest")
9+
// - ICINGA_TESTING_PGSQL_IMAGE: PostgreSQL container image to use (default: "postgres:latest")
10+
// - ICINGA_TESTING_REDIS_IMAGE: Redis container image to use (default: "redis:latest")
11+
// - ICINGA_TESTING_REDIS_MONITOR: If set to "1", log all Redis commands to the debug log using redis-cli monitor
12+
// - ICINGA_TESTING_ICINGADB_BINARY: Path to the Icinga DB binary to test. It will run in a container and therefore
13+
// must be compiled using CGO_ENABLED=0
14+
// - ICINGA_TESTING_ICINGADB_SCHEMA_MYSQL: Path to the full Icinga DB schema file for MySQL/MariaDB
15+
// - ICINGA_TESTING_ICINGADB_SCHEMA_PGSQL: Path to the full Icinga DB schema file for PostgreSQL
1616
package icingatesting
1717

1818
import (
@@ -41,14 +41,14 @@ import (
4141
// The intended use is to create a global variable of type *IT in the test package and then initialize it in TestMain
4242
// to allow the individual Test* functions to make use of it to dynamically start services as required:
4343
//
44-
// var it *icingatesting.IT
44+
// var it *icingatesting.IT
4545
//
46-
// func TestMain(m *testing.M) {
47-
// it = icingatesting.NewIT()
48-
// defer it.Cleanup()
46+
// func TestMain(m *testing.M) {
47+
// it = icingatesting.NewIT()
48+
// defer it.Cleanup()
4949
//
50-
// m.Run()
51-
// }
50+
// m.Run()
51+
// }
5252
type IT struct {
5353
mutex sync.Mutex
5454
deferredCleanup []func()

utils/database.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ type DB interface {
1919
//
2020
// Example usage:
2121
//
22-
// t.Log(utils.MustT(t).String(utils.PrettySelect(db, "SELECT * FROM somewhere")))
23-
//
22+
// t.Log(utils.MustT(t).String(utils.PrettySelect(db, "SELECT * FROM somewhere")))
2423
func PrettySelect(db DB, query string, args ...interface{}) (string, error) {
2524
cursor, err := db.Query(query, args...)
2625
if err != nil {

utils/variants_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func TestMakeVariantsAsBaseTypeSlice(t *testing.T) {
5757

5858
want := []T{
5959
// Base
60-
T{},
60+
{},
6161

6262
// A: {23, 42}
63-
T{A: 23},
64-
T{A: 42},
63+
{A: 23},
64+
{A: 42},
6565

6666
// B: {1337}
67-
T{B: 1337},
67+
{B: 1337},
6868
}
6969

7070
if !reflect.DeepEqual(got, want) {

0 commit comments

Comments
 (0)