convert uses of interface{} to any

Done via:
  find . -name "*.go" | xargs sed -i -E 's/interface\{\}/any/g'

PiperOrigin-RevId: 487033228
This commit is contained in:
Kevin Krakauer
2022-11-08 13:14:06 -08:00
committed by gVisor bot
parent c82b70015d
commit d8aa09e04c
220 changed files with 509 additions and 509 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ import (
// operation to run an analyzer with the object binary data.
type binaryAnalyzer interface {
// Run runs the analyzer with the given binary data.
Run(*analysis.Pass, io.Reader) (interface{}, error)
Run(*analysis.Pass, io.Reader) (any, error)
}
// analyzer is a simple analysis.Analyzer interface.
+2 -2
View File
@@ -388,7 +388,7 @@ func (i *importer) checkPackage(path string, srcs []string) (*types.Package, Fin
resultsMu sync.RWMutex // protects results & errs, findings.
factsMu sync.RWMutex // protects facts.
ready = make(map[*analysis.Analyzer]*sync.WaitGroup)
results = make(map[*analysis.Analyzer]interface{})
results = make(map[*analysis.Analyzer]any)
errs = make(map[*analysis.Analyzer]error)
findings = make(FindingSet, 0)
)
@@ -541,7 +541,7 @@ func (i *importer) checkPackage(path string, srcs []string) (*types.Package, Fin
// specific analyzers. The only panic that can happen
// is while resultsMu is held as a read-only lock.
var (
result interface{}
result any
err error
)
defer func() {
+6 -6
View File
@@ -62,7 +62,7 @@ func closeOutput(w io.Writer) {
}
// failure exits with the given failure message.
func failure(fmtStr string, v ...interface{}) subcommands.ExitStatus {
func failure(fmtStr string, v ...any) subcommands.ExitStatus {
fmt.Fprintf(os.Stderr, fmtStr+"\n", v...)
return subcommands.ExitFailure
}
@@ -179,7 +179,7 @@ func (c *Check) SetFlags(fs *flag.FlagSet) {
}
// Execute implements subcommands.Command.Execute.
func (c *Check) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
func (c *Check) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
if c.Package == "" {
c.Package = "main" // Default, no imports.
}
@@ -230,7 +230,7 @@ func (b *Bundle) SetFlags(fs *flag.FlagSet) {
}
// Execute implements subcommands.Command.Execute.
func (b *Bundle) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
func (b *Bundle) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
// Perform the analysis.
if err := b.execute(func() (check.FindingSet, facts.Serializer, error) {
// Discover the correct common root.
@@ -286,7 +286,7 @@ func (s *Stdlib) SetFlags(fs *flag.FlagSet) {
}
// Execute implements subcommands.Command.Execute.
func (s *Stdlib) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
func (s *Stdlib) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
if fs.NArg() != 0 {
return subcommands.ExitUsageError // Need no arguments.
}
@@ -398,7 +398,7 @@ func loadConfigs(filenames []string) (*config.Config, error) {
}
// Execute implements subcommands.Command.Execute.
func (f *Filter) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
func (f *Filter) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
// Open and merge all configuations.
config, err := loadConfigs(f.Configs)
if err != nil {
@@ -492,7 +492,7 @@ func (r *Render) SetFlags(fs *flag.FlagSet) {
}
// Execute implements subcommands.Command.Execute.
func (r *Render) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
func (r *Render) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
// Open the output file.
output, err := openOutput(r.Output, os.Stdout)
if err != nil {
+3 -3
View File
@@ -38,7 +38,7 @@ type Serializer interface {
// item is used for serialiation.
type item struct {
Key string
Value interface{}
Value any
}
// writeItems is an implementation of Serialize.
@@ -257,12 +257,12 @@ func (b *Bundle) Package(pkg *types.Package) (*Package, error) {
}
// Resolved is a human-readable fact format.
type Resolved map[string]interface{}
type Resolved map[string]any
// addRecursively adds a entry to a map recursively.
//
// Precondition: len(names) > 0.
func (r Resolved) addRecursively(names []string, value interface{}) {
func (r Resolved) addRecursively(names []string, value any) {
start := r
for i := 0; i < len(names)-1; i++ {
m, ok := start[names[i]]
+2 -2
View File
@@ -83,7 +83,7 @@ func (s *StringList) Set(value string) error {
}
// Get implements flag.Value.Get.
func (s *StringList) Get() interface{} {
func (s *StringList) Get() any {
return *s
}
@@ -100,7 +100,7 @@ func (s *StringMap) String() string {
}
// Get implements flag.Value.Get.
func (s *StringMap) Get() interface{} {
func (s *StringMap) Get() any {
return *s
}