From 907aefd43cd91d4452ca79f0aea8b6ae594c6e95 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 15 Dec 2021 17:00:06 -0800 Subject: [PATCH 1/2] libct: StartInitialization: fix %w related warning (on Go 1.18 this is actually an error) > libcontainer/factory_linux.go:341:10: fmt.Errorf format %w has arg e of wrong type interface{} Unfortunately, fixing it results in an errorlint warning: > libcontainer/factory_linux.go#L344 non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint) so we have to silence that one. Signed-off-by: Kir Kolyshkin --- libcontainer/factory_linux.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libcontainer/factory_linux.go b/libcontainer/factory_linux.go index 023d623f370..e6c71ac34e3 100644 --- a/libcontainer/factory_linux.go +++ b/libcontainer/factory_linux.go @@ -338,7 +338,12 @@ func (l *LinuxFactory) StartInitialization() (err error) { defer func() { if e := recover(); e != nil { - err = fmt.Errorf("panic from initialization: %w, %v", e, string(debug.Stack())) + if e, ok := e.(error); ok { + err = fmt.Errorf("panic from initialization: %w, %s", e, debug.Stack()) + } else { + //nolint:errorlint // here e is not of error type + err = fmt.Errorf("panic from initialization: %v, %s", e, debug.Stack()) + } } }() From b5cb405629900067bd29a2f4d64529714411c334 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 15 Dec 2021 16:50:20 -0800 Subject: [PATCH 2/2] ci: add go 1.18beta1 Signed-off-by: Kir Kolyshkin --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72f6eb377a9..e6aa0f89d4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.16.x, 1.17.x] + go-version: [1.16.x, 1.17.x, 1.18.0-beta1] rootless: ["rootless", ""] race: ["-race", ""] criu: [""]