From c53a1998c589a544b25d53f6e6fdf0f24a4df25b Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Thu, 2 Feb 2023 21:25:25 +0800 Subject: all: replace `interface{}` with `any` (#7330) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/testutil/golden.go | 4 ++-- internal/testutil/noop_logger.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/testutil') diff --git a/internal/testutil/golden.go b/internal/testutil/golden.go index 7f0295a0..57800e17 100644 --- a/internal/testutil/golden.go +++ b/internal/testutil/golden.go @@ -29,7 +29,7 @@ func Update(name string) bool { // AssertGolden compares what's got and what's in the golden file. It updates // the golden file on-demand. It does nothing when the runtime is "windows". -func AssertGolden(t testing.TB, path string, update bool, got interface{}) { +func AssertGolden(t testing.TB, path string, update bool, got any) { if runtime.GOOS == "windows" { t.Skip("Skipping testing on Windows") return @@ -59,7 +59,7 @@ func AssertGolden(t testing.TB, path string, update bool, got interface{}) { assert.Equal(t, string(golden), string(data)) } -func marshal(t testing.TB, v interface{}) []byte { +func marshal(t testing.TB, v any) []byte { t.Helper() switch v2 := v.(type) { diff --git a/internal/testutil/noop_logger.go b/internal/testutil/noop_logger.go index c13ebacd..db122390 100644 --- a/internal/testutil/noop_logger.go +++ b/internal/testutil/noop_logger.go @@ -26,6 +26,6 @@ func (*noopLogger) Write(log.Messager) error { } // InitNoopLogger is a init function to initialize a noop logger. -var InitNoopLogger = func(name string, vs ...interface{}) (log.Logger, error) { +var InitNoopLogger = func(name string, vs ...any) (log.Logger, error) { return &noopLogger{}, nil } -- cgit v1.2.3