diff options
author | Joe Chen <jc@unknwon.io> | 2023-02-02 21:25:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 21:25:25 +0800 |
commit | c53a1998c589a544b25d53f6e6fdf0f24a4df25b (patch) | |
tree | 1c3c9d693ba551eecfbc535be942e40b5acf9cf7 /internal/testutil | |
parent | 614382fec0ba05149785539ab93560d4d42c194d (diff) |
all: replace `interface{}` with `any` (#7330)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/testutil')
-rw-r--r-- | internal/testutil/golden.go | 4 | ||||
-rw-r--r-- | internal/testutil/noop_logger.go | 2 |
2 files changed, 3 insertions, 3 deletions
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 } |