From de195c024244114c2fc4c052954bc1fdbd8cde31 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 15 Sep 2023 07:28:18 +1200 Subject: [PATCH] refactor: use `any` instead of an empty interface --- internal/reporter/reporter.go | 2 +- pkg/lockfile/parse-pnpm-lock.go | 2 +- pkg/lockfile/parse-pubspec-lock.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/reporter/reporter.go b/internal/reporter/reporter.go index bdf7f468..784e3d68 100644 --- a/internal/reporter/reporter.go +++ b/internal/reporter/reporter.go @@ -65,7 +65,7 @@ func (r *Reporter) PrintResult(result Result) { // stdout as JSON. func (r *Reporter) PrintJSONResults() { out, err := json.Marshal(struct { - Results interface{} `json:"results"` + Results any `json:"results"` }{Results: r.results}) if err != nil { diff --git a/pkg/lockfile/parse-pnpm-lock.go b/pkg/lockfile/parse-pnpm-lock.go index 0971a963..a63d3ca0 100644 --- a/pkg/lockfile/parse-pnpm-lock.go +++ b/pkg/lockfile/parse-pnpm-lock.go @@ -32,7 +32,7 @@ type pnpmLockfileV6 struct { Packages map[string]PnpmLockPackage `yaml:"packages,omitempty"` } -func (l *PnpmLockfile) UnmarshalYAML(unmarshal func(interface{}) error) error { +func (l *PnpmLockfile) UnmarshalYAML(unmarshal func(any) error) error { var lockfileV6 pnpmLockfileV6 if err := unmarshal(&lockfileV6); err != nil { diff --git a/pkg/lockfile/parse-pubspec-lock.go b/pkg/lockfile/parse-pubspec-lock.go index 4574c301..ded9cd80 100644 --- a/pkg/lockfile/parse-pubspec-lock.go +++ b/pkg/lockfile/parse-pubspec-lock.go @@ -15,7 +15,7 @@ type PubspecLockDescription struct { var _ yaml.Unmarshaler = &PubspecLockDescription{} -func (pld *PubspecLockDescription) UnmarshalYAML(unmarshal func(interface{}) error) error { +func (pld *PubspecLockDescription) UnmarshalYAML(unmarshal func(any) error) error { var m struct { Name string `yaml:"name"` URL string `yaml:"url"`