From 1747433d1ca63970d55c60bca2a50df78f2976b9 Mon Sep 17 00:00:00 2001 From: yseto Date: Wed, 11 Dec 2024 14:20:40 +0900 Subject: [PATCH 1/5] use mackerelio/workflows@v1.2.0 --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1100c5d8..09f7d337 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,18 +12,18 @@ env: DEBIAN_FRONTEND: noninteractive jobs: lint: - uses: mackerelio/workflows/.github/workflows/go-lint.yml@v1.1.0 + uses: mackerelio/workflows/.github/workflows/go-lint.yml@v1.2.0 test: - uses: mackerelio/workflows/.github/workflows/go-test.yml@v1.1.0 + uses: mackerelio/workflows/.github/workflows/go-test.yml@v1.2.0 test-linux: - uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.1.0 + uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.2.0 with: run: | ./test.bash make testconvention os-versions: '["ubuntu-22.04"]' test-windows: - uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.1.0 + uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.2.0 with: run: | go build -o check-log/check-log.exe ./check-log From 4d4695219a4a1d945223200ba5b508ac4394c54f Mon Sep 17 00:00:00 2001 From: yseto Date: Wed, 11 Dec 2024 15:51:32 +0900 Subject: [PATCH 2/5] fix lint. --- check-dns/lib/check_dns_test.go | 6 +++--- check-log/lib/check-log.go | 4 ++-- check-smtp/lib/check-smtp_test.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/check-dns/lib/check_dns_test.go b/check-dns/lib/check_dns_test.go index cf50a987..eecbf91a 100644 --- a/check-dns/lib/check_dns_test.go +++ b/check-dns/lib/check_dns_test.go @@ -13,12 +13,12 @@ import ( func TestNameServer(t *testing.T) { nameserver, err := adapterAddress() if err != nil { - t.Errorf(err.Error()) + t.Error(err) } - t.Logf(nameserver) + t.Log(nameserver) address := net.ParseIP(nameserver) if address == nil { - t.Errorf("nameserver is invalid IP") + t.Error("nameserver is invalid IP") } } diff --git a/check-log/lib/check-log.go b/check-log/lib/check-log.go index f942c580..f3081855 100644 --- a/check-log/lib/check-log.go +++ b/check-log/lib/check-log.go @@ -290,7 +290,7 @@ func (opts *logOpts) searchLog(ctx context.Context, logFile string) (int64, int6 if opts.Encoding != "" { e := encoding.GetEncoding(opts.Encoding) if e == nil { - return 0, 0, "", fmt.Errorf("unknown encoding:" + opts.Encoding) + return 0, 0, "", fmt.Errorf("unknown encoding: %s", opts.Encoding) } opts.decoder = e.NewDecoder() } @@ -447,7 +447,7 @@ func parseFilePattern(directory, filePattern string, caseInsensitive bool) ([]st fileInfos, err := os.ReadDir(dirStr) if err != nil { - return nil, fmt.Errorf("cannot read the directory:" + err.Error()) + return nil, fmt.Errorf("cannot read the directory: %s", err.Error()) } var fileList []string diff --git a/check-smtp/lib/check-smtp_test.go b/check-smtp/lib/check-smtp_test.go index c38c0f9a..ed98ff55 100644 --- a/check-smtp/lib/check-smtp_test.go +++ b/check-smtp/lib/check-smtp_test.go @@ -39,7 +39,7 @@ func (m *mockSMTPServer) runServe() error { tc := textproto.NewConn(conn) for _, res := range m.responses { - if err := tc.PrintfLine(res); err != nil { + if err := tc.PrintfLine(res); err != nil { // nolint errCh <- err return } From 96b23ed483956f1537682eb156929fcccffea19c Mon Sep 17 00:00:00 2001 From: yseto Date: Wed, 11 Dec 2024 15:56:39 +0900 Subject: [PATCH 3/5] s/docker-compose/docker compose/ --- check-mysql/test_57/test.sh | 8 ++++---- check-mysql/test_8/test.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/check-mysql/test_57/test.sh b/check-mysql/test_57/test.sh index 381721b4..df896834 100755 --- a/check-mysql/test_57/test.sh +++ b/check-mysql/test_57/test.sh @@ -4,9 +4,9 @@ set -ex echo $0 prog=$(basename $0) -if ! command -v docker-compose > /dev/null +if ! command -v docker > /dev/null then - echo "$prog: docker-compose is not installed" >&2 + echo "$prog: docker is not installed" >&2 exit 2 fi @@ -28,8 +28,8 @@ if $plugin connection --host=127.0.0.1 --port=$primary_port --user=$user --passw exit 1 fi -docker-compose up -d -trap 'docker-compose down --rmi local -v' EXIT +docker compose up -d +trap 'docker compose down --rmi local -v' EXIT USER=$user PASSWORD=$password PORT=$primary_port ../wait.sh diff --git a/check-mysql/test_8/test.sh b/check-mysql/test_8/test.sh index 2a883366..b2774513 100755 --- a/check-mysql/test_8/test.sh +++ b/check-mysql/test_8/test.sh @@ -4,9 +4,9 @@ set -ex echo $0 prog=$(basename $0) -if ! command -v docker-compose > /dev/null +if ! command -v docker > /dev/null then - echo "$prog: docker-compose is not installed" >&2 + echo "$prog: docker is not installed" >&2 exit 2 fi @@ -28,8 +28,8 @@ if $plugin connection --host=127.0.0.1 --port=$primary_port --user=$user --passw exit 1 fi -docker-compose up -d -trap 'docker-compose down --rmi local -v' EXIT +docker compose up -d +trap 'docker compose down --rmi local -v' EXIT USER=$user PASSWORD=$password PORT=$primary_port ../wait.sh From 0b44617fce9eb7870b737d63cdd11cc39673b1ae Mon Sep 17 00:00:00 2001 From: yseto Date: Wed, 11 Dec 2024 16:08:28 +0900 Subject: [PATCH 4/5] update mysql container. --- check-mysql/test_57/docker-compose.yml | 4 ++-- check-mysql/test_8/docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/check-mysql/test_57/docker-compose.yml b/check-mysql/test_57/docker-compose.yml index 8dee718b..31217e3d 100644 --- a/check-mysql/test_57/docker-compose.yml +++ b/check-mysql/test_57/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.1' services: primary: - image: mysql:5.7.8 + image: mysql:5.7.44 platform: linux/amd64 environment: MYSQL_ROOT_PASSWORD: mysql @@ -17,7 +17,7 @@ services: - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d replica: - image: mysql:5.7.8 + image: mysql:5.7.44 platform: linux/amd64 environment: MYSQL_ROOT_PASSWORD: mysql diff --git a/check-mysql/test_8/docker-compose.yml b/check-mysql/test_8/docker-compose.yml index d827aea9..3d8f2fe4 100644 --- a/check-mysql/test_8/docker-compose.yml +++ b/check-mysql/test_8/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.1' services: primary: - image: mysql:8.0.23 + image: mysql:8.0.40 platform: linux/amd64 environment: MYSQL_ROOT_PASSWORD: mysql @@ -17,7 +17,7 @@ services: - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d replica: - image: mysql:8.0.23 + image: mysql:8.0.40 platform: linux/amd64 environment: MYSQL_ROOT_PASSWORD: mysql From c321b944e2c8c35a644dc16e5fb009b695d1f38f Mon Sep 17 00:00:00 2001 From: yseto Date: Wed, 11 Dec 2024 16:17:26 +0900 Subject: [PATCH 5/5] need t.Helper --- check-windows-eventlog/lib/check_windows_eventlog_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/check-windows-eventlog/lib/check_windows_eventlog_test.go b/check-windows-eventlog/lib/check_windows_eventlog_test.go index 28b483d0..bed01b5a 100644 --- a/check-windows-eventlog/lib/check_windows_eventlog_test.go +++ b/check-windows-eventlog/lib/check_windows_eventlog_test.go @@ -48,6 +48,7 @@ func TestWriteLastOffset(t *testing.T) { } func raiseEvent(t *testing.T, typ int, msg string) { + t.Helper() ole.CoInitialize(0) defer ole.CoUninitialize()