Repository: kythe/kythe
Pull request #5649 (2023-05-22 19:03:52)

style: cleanup Go lint


Patch:
diff --git a/kythe/go/extractors/bazel/extractor.go b/kythe/go/extractors/bazel/extractor.go
index 6270eac38..a676f2529 100644
--- a/kythe/go/extractors/bazel/extractor.go
+++ b/kythe/go/extractors/bazel/extractor.go
@@ -149,7 +149,7 @@ func (c *Config) openRead(ctx context.Context, path string) (io.ReadCloser, erro
 	return os.Open(path)
 }
 
-func (c *Config) logPrintf(msg string, args ...interface{}) {
+func (c *Config) logPrintf(msg string, args ...any) {
 	if c.Verbose {
 		log.Infof(msg, args...)
 	}
diff --git a/kythe/go/extractors/cmd/gotool/gotool.go b/kythe/go/extractors/cmd/gotool/gotool.go
index d2f15a9ee..c2eb2d49e 100644
--- a/kythe/go/extractors/cmd/gotool/gotool.go
+++ b/kythe/go/extractors/cmd/gotool/gotool.go
@@ -81,14 +81,14 @@ Options:
 	// TODO(fromberger): Attach flags to the build and release tags (maybe).
 }
 
-func maybeFatal(msg string, args ...interface{}) {
+func maybeFatal(msg string, args ...any) {
 	log.Errorf(msg, args...)
 	if !*keepGoing {
 		os.Exit(1)
 	}
 }
 
-func maybeLog(msg string, args ...interface{}) {
+func maybeLog(msg string, args ...any) {
 	if *verbose {
 		log.Infof(msg, args...)
 	}
diff --git a/kythe/go/extractors/config/runextractor/cmakecmd/cmakecmd.go b/kythe/go/extractors/config/runextractor/cmakecmd/cmakecmd.go
index ee2cc0f64..0f64711cf 100644
--- a/kythe/go/extractors/config/runextractor/cmakecmd/cmakecmd.go
+++ b/kythe/go/extractors/config/runextractor/cmakecmd/cmakecmd.go
@@ -75,7 +75,7 @@ func (c *cmakeCommand) checkFlags() error {
 }
 
 // Execute implements the subcommands interface and runs cmake extraction.
-func (c *cmakeCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (c *cmakeCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if err := c.checkFlags(); err != nil {
 		return c.Fail("Incorrect flags: %v", err)
 	}
diff --git a/kythe/go/extractors/config/runextractor/compdbcmd/compdbcmd.go b/kythe/go/extractors/config/runextractor/compdbcmd/compdbcmd.go
index a86b76dc3..d5fb559ae 100644
--- a/kythe/go/extractors/config/runextractor/compdbcmd/compdbcmd.go
+++ b/kythe/go/extractors/config/runextractor/compdbcmd/compdbcmd.go
@@ -68,7 +68,7 @@ func (c *compdbCommand) checkFlags() error {
 }
 
 // Execute implements the subcommands interface and runs compdb extraction.
-func (c *compdbCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (c *compdbCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if err := c.checkFlags(); err != nil {
 		return c.Fail("Incorrect flags: %v", err)
 	}
diff --git a/kythe/go/extractors/config/runextractor/gradlecmd/gradlecmd.go b/kythe/go/extractors/config/runextractor/gradlecmd/gradlecmd.go
index 4c34847e5..072fcffdb 100644
--- a/kythe/go/extractors/config/runextractor/gradlecmd/gradlecmd.go
+++ b/kythe/go/extractors/config/runextractor/gradlecmd/gradlecmd.go
@@ -70,7 +70,7 @@ func (g gradleCommand) checkFlags() error {
 }
 
 // Execute implements the subcommands interface and runs gradle extraction.
-func (g *gradleCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (g *gradleCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if err := g.checkFlags(); err != nil {
 		return g.Fail("incorrect flags: %v", err)
 	}
diff --git a/kythe/go/extractors/config/runextractor/mavencmd/mavencmd.go b/kythe/go/extractors/config/runextractor/mavencmd/mavencmd.go
index 8150d559b..a4e8e6591 100644
--- a/kythe/go/extractors/config/runextractor/mavencmd/mavencmd.go
+++ b/kythe/go/extractors/config/runextractor/mavencmd/mavencmd.go
@@ -74,7 +74,7 @@ func (m mavenCommand) checkFlags() error {
 }
 
 // Execute implements the subcommands interface and runs maven extraction.
-func (m *mavenCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (m *mavenCommand) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if err := m.checkFlags(); err != nil {
 		return m.Fail("invalid flags: %v", err)
 	}
diff --git a/kythe/go/indexer/emit.go b/kythe/go/indexer/emit.go
index 46945c1c8..f649971da 100644
--- a/kythe/go/indexer/emit.go
+++ b/kythe/go/indexer/emit.go
@@ -393,7 +393,7 @@ func (e *emitter) emitTApp(ms *cpb.MarkedSource, ctorKind string, ctor *spb.VNam
 			e.emitBuiltinMarkedSource(ctor)
 		}
 	}
-	components := []interface{}{ctor}
+	components := []any{ctor}
 	for _, p := range params {
 		components = append(components, p)
 	}
diff --git a/kythe/go/indexer/facts.go b/kythe/go/indexer/facts.go
index b804bd192..97cfcfa3f 100644
--- a/kythe/go/indexer/facts.go
+++ b/kythe/go/indexer/facts.go
@@ -101,7 +101,7 @@ func (s Sink) writeDiagnostic(ctx context.Context, src *spb.VName, d diagnostic)
 	return s.writeEdge(ctx, src, dname, edges.Tagged)
 }
 
-func hashSignature(s ...interface{}) string {
+func hashSignature(s ...any) string {
 	hash := sha256.New()
 	fmt.Fprintln(hash, s...)
 	return base64.URLEncoding.EncodeToString(hash.Sum(nil)[:])
diff --git a/kythe/go/languageserver/handler.go b/kythe/go/languageserver/handler.go
index e3088783e..dd5c15940 100644
--- a/kythe/go/languageserver/handler.go
+++ b/kythe/go/languageserver/handler.go
@@ -31,9 +31,9 @@ import (
 func ServerHandler(ls *Server) jsonrpc2.Handler {
 	shutdownIssued := false
 	return jsonrpc2.HandlerWithError(
-		func(c context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (interface{}, error) {
+		func(c context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (any, error) {
 			var (
-				ret interface{}
+				ret any
 				err error
 			)
 
diff --git a/kythe/go/localrun/localrun.go b/kythe/go/localrun/localrun.go
index 2dd2cda65..f28c9790b 100644
--- a/kythe/go/localrun/localrun.go
+++ b/kythe/go/localrun/localrun.go
@@ -476,7 +476,7 @@ func (si *serialIndexer) run(ctx context.Context, kzips []string) (io.Reader, er
 
 	// TODO: Dedup the kzips instead of keeping them all around.
 	for i, k := range kzips {
-		log := func(i int, m string, v ...interface{}) {
+		log := func(i int, m string, v ...any) {
 			den := len(kzips)
 			log.Infof("[%d/%d] %v", i, den, fmt.Sprintf(m, v...))
 		}
diff --git a/kythe/go/platform/analysis/proxy/proxy.go b/kythe/go/platform/analysis/proxy/proxy.go
index ba88f2593..2159069e4 100644
--- a/kythe/go/platform/analysis/proxy/proxy.go
+++ b/kythe/go/platform/analysis/proxy/proxy.go
@@ -124,8 +124,8 @@ type request struct {
 
 // A response represents a response from the proxy to the indexer.
 type response struct {
-	Status string      `json:"rsp"` // status message
-	Args   interface{} `json:"args,omitempty"`
+	Status string `json:"rsp"` // status message
+	Args   any    `json:"args,omitempty"`
 }
 
 // A unit represents a compilation unit (in JSON form) to be analyzed.
@@ -377,7 +377,7 @@ func decodeWireEntries(jsonArray json.RawMessage) ([]*spb.Entry, error) {
 	return entries, nil
 }
 
-func (p *Proxy) reply(status string, args interface{}) {
+func (p *Proxy) reply(status string, args any) {
 	p.err = p.out.Encode(&response{
 		Status: status,
 		Args:   args,
diff --git a/kythe/go/platform/cache/cache.go b/kythe/go/platform/cache/cache.go
index 037df0834..f7a496bad 100644
--- a/kythe/go/platform/cache/cache.go
+++ b/kythe/go/platform/cache/cache.go
@@ -177,7 +177,7 @@ func (h countHeap) Swap(i, j int) {
 }
 
 // Push implements a method of heap.Interface.
-func (h *countHeap) Push(item interface{}) {
+func (h *countHeap) Push(item any) {
 	if e, ok := item.(*entry); ok {
 		n := len(*h)
 		e.index = n
@@ -186,7 +186,7 @@ func (h *countHeap) Push(item interface{}) {
 }
 
 // Pop implements a method of heap.Interface.
-func (h *countHeap) Pop() interface{} {
+func (h *countHeap) Pop() any {
 	if n := len(*h) - 1; n >= 0 {
 		e := (*h)[n]
 		e.index = -1
@@ -211,7 +211,7 @@ type ByteSize int
 func (b *ByteSize) String() string { return fmt.Sprintf("%d", *b) }
 
 // Get implements a method of the flag.Value interface.
-func (b *ByteSize) Get() interface{} { return *b }
+func (b *ByteSize) Get() any { return *b }
 
 // Set implements a method of the flag.Value interface.
 func (b *ByteSize) Set(s string) error {
diff --git a/kythe/go/platform/kcd/kythe/units.go b/kythe/go/platform/kcd/kythe/units.go
index 0c5b6820c..4846fea34 100644
--- a/kythe/go/platform/kcd/kythe/units.go
+++ b/kythe/go/platform/kcd/kythe/units.go
@@ -177,7 +177,7 @@ func (u Unit) pathKey(inputPath string) string {
 
 // ConvertUnit reports whether v can be converted to a Kythe kcd.Unit, and if
 // so returns the appropriate implementation.
-func ConvertUnit(v interface{}) (kcd.Unit, bool) {
+func ConvertUnit(v any) (kcd.Unit, bool) {
 	if u, ok := v.(*apb.CompilationUnit); ok {
 		return Unit{u}, true
 	}
diff --git a/kythe/go/platform/kzip/info/info.go b/kythe/go/platform/kzip/info/info.go
index b367a8ec7..e42e30539 100644
--- a/kythe/go/platform/kzip/info/info.go
+++ b/kythe/go/platform/kzip/info/info.go
@@ -54,7 +54,7 @@ func KzipInfo(f kzip.File, fileSize int64, scanOpts ...kzip.ScanOption) (*apb.Kz
 //	a.Accumulate(unit) // call for each compilation unit
 //	info := a.Get()    // get the resulting KzipInfo
 type Accumulator struct {
-	*apb.KzipInfo
+	KzipInfo *apb.KzipInfo
 }
 
 // NewAccumulator creates a new Accumulator instance given the kzip fileSize (in
@@ -142,8 +142,8 @@ func requiredInputCorpus(u *kzip.Unit, ri *apb.CompilationUnit_FileInput) string
 }
 
 // KzipInfoTotalCount returns the total CompilationUnits counts for infos split apart by language.
-func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
-	totals := apb.KzipInfo_CorpusInfo{
+func KzipInfoTotalCount(infos []*apb.KzipInfo) *apb.KzipInfo_CorpusInfo {
+	totals := &apb.KzipInfo_CorpusInfo{
 		LanguageRequiredInputs: make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 		LanguageSources:        make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 	}
diff --git a/kythe/go/platform/tools/entrystream/entrystream.go b/kythe/go/platform/tools/entrystream/entrystream.go
index 5b4dc6d16..53ef08599 100644
--- a/kythe/go/platform/tools/entrystream/entrystream.go
+++ b/kythe/go/platform/tools/entrystream/entrystream.go
@@ -256,7 +256,7 @@ func sortEntries(rd stream.EntryReader) (stream.EntryReader, error) {
 	}
 
 	return func(f func(*spb.Entry) error) error {
-		return sorter.Read(func(i interface{}) error {
+		return sorter.Read(func(i any) error {
 			return f(i.(*spb.Entry))
 		})
 	}, nil
@@ -264,15 +264,15 @@ func sortEntries(rd stream.EntryReader) (stream.EntryReader, error) {
 
 type entryLesser struct{}
 
-func (entryLesser) Less(a, b interface{}) bool {
+func (entryLesser) Less(a, b any) bool {
 	return compare.Entries(a.(*spb.Entry), b.(*spb.Entry)) == compare.LT
 }
 
 type entryMarshaler struct{}
 
-func (entryMarshaler) Marshal(x interface{}) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
+func (entryMarshaler) Marshal(x any) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
 
-func (entryMarshaler) Unmarshal(rec []byte) (interface{}, error) {
+func (entryMarshaler) Unmarshal(rec []byte) (any, error) {
 	var e spb.Entry
 	return &e, proto.Unmarshal(rec, &e)
 }
diff --git a/kythe/go/platform/tools/kzip/createcmd/createcmd.go b/kythe/go/platform/tools/kzip/createcmd/createcmd.go
index a9fd26b58..818d36aed 100644
--- a/kythe/go/platform/tools/kzip/createcmd/createcmd.go
+++ b/kythe/go/platform/tools/kzip/createcmd/createcmd.go
@@ -92,7 +92,7 @@ func (c *createCommand) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements the subcommands interface and creates the requested file.
-func (c *createCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
+func (c *createCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...any) subcommands.ExitStatus {
 	switch {
 	case c.uri.Corpus == "":
 		return c.Fail("Missing required -uri")
diff --git a/kythe/go/platform/tools/kzip/createcmd/flag.go b/kythe/go/platform/tools/kzip/createcmd/flag.go
index fdec3425f..bfb2cb7c5 100644
--- a/kythe/go/platform/tools/kzip/createcmd/flag.go
+++ b/kythe/go/platform/tools/kzip/createcmd/flag.go
@@ -50,7 +50,7 @@ func (f *repeatedString) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *repeatedString) Get() interface{} {
+func (f *repeatedString) Get() any {
 	if f == nil {
 		return []string(nil)
 	}
@@ -85,7 +85,7 @@ func (f *repeatedEnv) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *repeatedEnv) Get() interface{} {
+func (f *repeatedEnv) Get() any {
 	if f == nil {
 		return map[string]string(nil)
 	}
@@ -132,7 +132,7 @@ func (f *kytheURI) String() string {
 }
 
 // Get implements part of the flag.Getter interface.
-func (f *kytheURI) Get() interface{} {
+func (f *kytheURI) Get() any {
 	return f
 }
 
@@ -175,7 +175,7 @@ func (f *repeatedAny) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *repeatedAny) Get() interface{} {
+func (f *repeatedAny) Get() any {
 	if f == nil {
 		return []*anypb.Any(nil)
 	}
@@ -208,6 +208,6 @@ func (f *vnameRules) String() string {
 }
 
 // Get implements part of the flag.Getter interface.
-func (f *vnameRules) Get() interface{} {
+func (f *vnameRules) Get() any {
 	return f
 }
diff --git a/kythe/go/platform/tools/kzip/filtercmd/filtercmd.go b/kythe/go/platform/tools/kzip/filtercmd/filtercmd.go
index eb15a5127..2b65790fe 100644
--- a/kythe/go/platform/tools/kzip/filtercmd/filtercmd.go
+++ b/kythe/go/platform/tools/kzip/filtercmd/filtercmd.go
@@ -62,7 +62,7 @@ func (c *filterCommand) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements the subcommands interface and filters the input file.
-func (c *filterCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
+func (c *filterCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...any) subcommands.ExitStatus {
 	if c.output == "" {
 		return c.Fail("Required --output path missing")
 	}
diff --git a/kythe/go/platform/tools/kzip/flags/encoding.go b/kythe/go/platform/tools/kzip/flags/encoding.go
index f03096381..284ae4fad 100644
--- a/kythe/go/platform/tools/kzip/flags/encoding.go
+++ b/kythe/go/platform/tools/kzip/flags/encoding.go
@@ -32,7 +32,7 @@ func (e *EncodingFlag) String() string {
 }
 
 // Get implements part of the flag.Getter interface.
-func (e *EncodingFlag) Get() interface{} {
+func (e *EncodingFlag) Get() any {
 	return e.Encoding
 }
 
diff --git a/kythe/go/platform/tools/kzip/infocmd/infocmd.go b/kythe/go/platform/tools/kzip/infocmd/infocmd.go
index e49cc26ae..0f6058995 100644
--- a/kythe/go/platform/tools/kzip/infocmd/infocmd.go
+++ b/kythe/go/platform/tools/kzip/infocmd/infocmd.go
@@ -59,7 +59,7 @@ func (c *infoCommand) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements the subcommands interface and gathers info from the requested file.
-func (c *infoCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
+func (c *infoCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...any) subcommands.ExitStatus {
 	if c.input == "" {
 		return c.Fail("Required --input path missing")
 	}
diff --git a/kythe/go/platform/tools/kzip/mergecmd/flag.go b/kythe/go/platform/tools/kzip/mergecmd/flag.go
index bc9960d84..3f86471df 100644
--- a/kythe/go/platform/tools/kzip/mergecmd/flag.go
+++ b/kythe/go/platform/tools/kzip/mergecmd/flag.go
@@ -49,6 +49,6 @@ func (f *vnameRules) String() string {
 }
 
 // Get implements part of the flag.Getter interface.
-func (f *vnameRules) Get() interface{} {
+func (f *vnameRules) Get() any {
 	return f
 }
diff --git a/kythe/go/platform/tools/kzip/mergecmd/mergecmd.go b/kythe/go/platform/tools/kzip/mergecmd/mergecmd.go
index 3f0814fa8..554c94f3b 100644
--- a/kythe/go/platform/tools/kzip/mergecmd/mergecmd.go
+++ b/kythe/go/platform/tools/kzip/mergecmd/mergecmd.go
@@ -70,7 +70,7 @@ func (c *mergeCommand) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements the subcommands interface and merges the provided files.
-func (c *mergeCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
+func (c *mergeCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...any) subcommands.ExitStatus {
 	if c.output == "" {
 		return c.Fail("Required --output path missing")
 	}
diff --git a/kythe/go/platform/tools/kzip/metadatacmd/metadatacmd.go b/kythe/go/platform/tools/kzip/metadatacmd/metadatacmd.go
index 2a5ae2f2e..dd604cb93 100644
--- a/kythe/go/platform/tools/kzip/metadatacmd/metadatacmd.go
+++ b/kythe/go/platform/tools/kzip/metadatacmd/metadatacmd.go
@@ -66,7 +66,7 @@ func (c *metadataCommand) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements the subcommands interface and creates a metadata kzip file.
-func (c *metadataCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...interface{}) (exitcode subcommands.ExitStatus) {
+func (c *metadataCommand) Execute(ctx context.Context, fs *flag.FlagSet, _ ...any) (exitcode subcommands.ExitStatus) {
 	if c.output == "" {
 		return c.Fail("Required --output path missing")
 	}
diff --git a/kythe/go/platform/tools/kzip/viewcmd/viewcmd.go b/kythe/go/platform/tools/kzip/viewcmd/viewcmd.go
index c3bab148e..1f4edcff7 100644
--- a/kythe/go/platform/tools/kzip/viewcmd/viewcmd.go
+++ b/kythe/go/platform/tools/kzip/viewcmd/viewcmd.go
@@ -66,7 +66,7 @@ func (c *cmd) SetFlags(fs *flag.FlagSet) {
 }
 
 // Execute implements part of subcommands.Command.
-func (c *cmd) Execute(ctx context.Context, fs *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (c *cmd) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	var hasErrors bool
 	for _, path := range fs.Args() {
 		ext := filepath.Ext(path)
diff --git a/kythe/go/services/cli/cli.go b/kythe/go/services/cli/cli.go
index dbeca05fa..f4345d872 100644
--- a/kythe/go/services/cli/cli.go
+++ b/kythe/go/services/cli/cli.go
@@ -99,7 +99,7 @@ func RegisterCommand(c KytheCommand, group string) {
 
 type commandWrapper struct{ KytheCommand }
 
-func (w *commandWrapper) Execute(ctx context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (w *commandWrapper) Execute(ctx context.Context, f *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if len(args) != 1 {
 		return subcommands.ExitUsageError
 	}
@@ -148,9 +148,9 @@ func PrintJSONMessage(resp proto.Message) error { return jsonMarshaler.Marshal(o
 // PrintJSON prints the given value to the console.  This should be called
 // whenever the DisplayJSON flag is true.  PrintJSONMessage should be preferred
 // when possible.
-func PrintJSON(val interface{}) error { return json.NewEncoder(out).Encode(val) }
+func PrintJSON(val any) error { return json.NewEncoder(out).Encode(val) }
 
-func baseTypeName(x interface{}) string {
+func baseTypeName(x any) string {
 	ss := strings.SplitN(fmt.Sprintf("%T", x), ".", 2)
 	if len(ss) == 2 {
 		return ss[1]
diff --git a/kythe/go/services/web/web.go b/kythe/go/services/web/web.go
index a5b09bb34..1a3630fee 100644
--- a/kythe/go/services/web/web.go
+++ b/kythe/go/services/web/web.go
@@ -115,7 +115,7 @@ func WriteResponse(w http.ResponseWriter, r *http.Request, msg proto.Message) er
 }
 
 // WriteJSONResponse encodes v as JSON and writes it to w.
-func WriteJSONResponse(w http.ResponseWriter, r *http.Request, v interface{}) error {
+func WriteJSONResponse(w http.ResponseWriter, r *http.Request, v any) error {
 	w.Header().Set("Content-Type", "application/json; charset=utf-8")
 	cw := httpencoding.CompressData(w, r)
 	defer cw.Close()
diff --git a/kythe/go/serving/graph/graph.go b/kythe/go/serving/graph/graph.go
index 850fa031a..d4a0a0b54 100644
--- a/kythe/go/serving/graph/graph.go
+++ b/kythe/go/serving/graph/graph.go
@@ -44,7 +44,7 @@ import (
 	srvpb "kythe.io/kythe/proto/serving_go_proto"
 )
 
-func tracePrintf(ctx context.Context, msg string, args ...interface{}) {
+func tracePrintf(ctx context.Context, msg string, args ...any) {
 	if t, ok := trace.FromContext(ctx); ok {
 		t.LazyPrintf(msg, args...)
 	}
diff --git a/kythe/go/serving/pipeline/beamio/shards.go b/kythe/go/serving/pipeline/beamio/shards.go
index 753a011d4..fd7badf36 100644
--- a/kythe/go/serving/pipeline/beamio/shards.go
+++ b/kythe/go/serving/pipeline/beamio/shards.go
@@ -30,7 +30,7 @@ func init() {
 	beam.RegisterFunction(computeShard)
 	beam.RegisterFunction(assignKeyWeights)
 	beam.RegisterType(reflect.TypeOf((*computeMinKvSize)(nil)).Elem())
-	reflectx.RegisterFunc(reflect.ValueOf(bytesLessFn).Type(), func(_ interface{}) reflectx.Func {
+	reflectx.RegisterFunc(reflect.ValueOf(bytesLessFn).Type(), func(_ any) reflectx.Func {
 		return newBytesLess()
 	})
 }
@@ -58,8 +58,8 @@ func (i *bytesLess) Name() string {
 func (i *bytesLess) Type() reflect.Type {
 	return i.t
 }
-func (i *bytesLess) Call(args []interface{}) []interface{} {
-	return []interface{}{bytesLessFn(args[0].([]byte), args[1].([]byte))}
+func (i *bytesLess) Call(args []any) []any {
+	return []any{bytesLessFn(args[0].([]byte), args[1].([]byte))}
 }
 
 // Input is PCollection of beamio.KeyValue<[]byte, []byte>, output is PCollection of *ppb.KeyWeights.
diff --git a/kythe/go/serving/pipeline/nodes/nodes.go b/kythe/go/serving/pipeline/nodes/nodes.go
index 22a6084b2..9f6f73d50 100644
--- a/kythe/go/serving/pipeline/nodes/nodes.go
+++ b/kythe/go/serving/pipeline/nodes/nodes.go
@@ -188,7 +188,7 @@ func compareEdges(a, b *scpb.Edge) compare.Order {
 		AndThen(a.GetGenericKind(), b.GetGenericKind()).
 		AndThen(int(a.Ordinal), int(b.Ordinal)).
 		AndThen(a.Target, b.Target,
-			compare.With(func(a, b interface{}) compare.Order {
+			compare.With(func(a, b any) compare.Order {
 				return compare.VNames(a.(*spb.VName), b.(*spb.VName))
 			}))
 }
diff --git a/kythe/go/serving/pipeline/pipeline.go b/kythe/go/serving/pipeline/pipeline.go
index 76aeec21d..7a66e11c2 100644
--- a/kythe/go/serving/pipeline/pipeline.go
+++ b/kythe/go/serving/pipeline/pipeline.go
@@ -132,7 +132,7 @@ func Run(ctx context.Context, rd stream.EntryReader, db keyvalue.DB, opts *Optio
 		}
 	}()
 
-	err := sortedEdges.Read(func(x interface{}) error {
+	err := sortedEdges.Read(func(x any) error {
 		e := x.(*srvpb.Edge)
 		pesIn <- e
 		dIn <- e
@@ -189,7 +189,7 @@ func combineNodesAndEdges(ctx context.Context, opts *Options, out *servingOutput
 	}
 
 	var n *srvpb.Node
-	if err := partialSorter.Read(func(i interface{}) error {
+	if err := partialSorter.Read(func(i any) error {
 		e := i.(*srvpb.Edge)
 		if n == nil || n.Ticket != e.Source.Ticket {
 			n = e.Source
@@ -362,7 +362,7 @@ type decorationFragment struct {
 
 type fragmentLesser struct{}
 
-func (fragmentLesser) Less(a, b interface{}) bool {
+func (fragmentLesser) Less(a, b any) bool {
 	x, y := a.(*decorationFragment), b.(*decorationFragment)
 	if x.fileTicket == y.fileTicket {
 		if len(x.decoration.Decoration) == 0 || len(y.decoration.Decoration) == 0 {
@@ -418,7 +418,7 @@ func writeDecorAndRefs(ctx context.Context, opts *Options, edges <-chan *srvpb.E
 		decor   *srvpb.FileDecorations
 		targets map[string]*srvpb.Node
 	)
-	if err := fragments.Read(func(x interface{}) error {
+	if err := fragments.Read(func(x any) error {
 		df := x.(*decorationFragment)
 		fileTicket := df.fileTicket
 		fragment := df.decoration
@@ -494,7 +494,7 @@ func writeDecorAndRefs(ctx context.Context, opts *Options, edges <-chan *srvpb.E
 		},
 	}
 	var curTicket string
-	if err := refSorter.Read(func(i interface{}) error {
+	if err := refSorter.Read(func(i any) error {
 		cr := i.(*ipb.CrossReference)
 
 		if curTicket != cr.Referent.Ticket {
@@ -536,7 +536,7 @@ func writeDecor(ctx context.Context, t table.BufferedProto, decor *srvpb.FileDec
 
 type edgeLesser struct{}
 
-func (edgeLesser) Less(a, b interface{}) bool {
+func (edgeLesser) Less(a, b any) bool {
 	x, y := a.(*srvpb.Edge), b.(*srvpb.Edge)
 	if x.Source.Ticket == y.Source.Ticket {
 		if x.Target == nil || y.Target == nil {
@@ -555,16 +555,16 @@ func (edgeLesser) Less(a, b interface{}) bool {
 
 type edgeMarshaler struct{}
 
-func (edgeMarshaler) Marshal(x interface{}) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
+func (edgeMarshaler) Marshal(x any) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
 
-func (edgeMarshaler) Unmarshal(rec []byte) (interface{}, error) {
+func (edgeMarshaler) Unmarshal(rec []byte) (any, error) {
 	var e srvpb.Edge
 	return &e, proto.Unmarshal(rec, &e)
 }
 
 type fragmentMarshaler struct{}
 
-func (fragmentMarshaler) Marshal(x interface{}) ([]byte, error) {
+func (fragmentMarshaler) Marshal(x any) ([]byte, error) {
 	f := x.(*decorationFragment)
 	rec, err := proto.Marshal(f.decoration)
 	if err != nil {
@@ -573,7 +573,7 @@ func (fragmentMarshaler) Marshal(x interface{}) ([]byte, error) {
 	return bytes.Join([][]byte{[]byte(f.fileTicket), rec}, []byte("\000")), nil
 }
 
-func (fragmentMarshaler) Unmarshal(rec []byte) (interface{}, error) {
+func (fragmentMarshaler) Unmarshal(rec []byte) (any, error) {
 	ss := bytes.SplitN(rec, []byte("\000"), 2)
 	if len(ss) != 2 {
 		return nil, errors.New("invalid decorationFragment encoding")
@@ -590,16 +590,16 @@ func (fragmentMarshaler) Unmarshal(rec []byte) (interface{}, error) {
 
 type refMarshaler struct{}
 
-func (refMarshaler) Marshal(x interface{}) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
+func (refMarshaler) Marshal(x any) ([]byte, error) { return proto.Marshal(x.(proto.Message)) }
 
-func (refMarshaler) Unmarshal(rec []byte) (interface{}, error) {
+func (refMarshaler) Unmarshal(rec []byte) (any, error) {
 	var e ipb.CrossReference
 	return &e, proto.Unmarshal(rec, &e)
 }
 
 type refLesser struct{}
 
-func (refLesser) Less(a, b interface{}) bool {
+func (refLesser) Less(a, b any) bool {
 	x, y := a.(*ipb.CrossReference), b.(*ipb.CrossReference)
 	if x.Referent.Ticket == y.Referent.Ticket {
 		if x.TargetAnchor == nil || y.TargetAnchor == nil {
diff --git a/kythe/go/serving/xrefs/xrefs.go b/kythe/go/serving/xrefs/xrefs.go
index b49f51f22..61d60a9a5 100644
--- a/kythe/go/serving/xrefs/xrefs.go
+++ b/kythe/go/serving/xrefs/xrefs.go
@@ -1667,7 +1667,7 @@ func clearSnippet(anchor *xpb.Anchor) {
 	anchor.SnippetSpan = nil
 }
 
-func tracePrintf(ctx context.Context, msg string, args ...interface{}) {
+func tracePrintf(ctx context.Context, msg string, args ...any) {
 	if t, ok := trace.FromContext(ctx); ok {
 		t.LazyPrintf(msg, args...)
 	}
diff --git a/kythe/go/storage/gsutil/gsutil.go b/kythe/go/storage/gsutil/gsutil.go
index cc233ae50..563a7f831 100644
--- a/kythe/go/storage/gsutil/gsutil.go
+++ b/kythe/go/storage/gsutil/gsutil.go
@@ -76,7 +76,7 @@ func (f *gsFlag) String() string {
 }
 
 // Get implements part of the flag.Getter interface.
-func (f *gsFlag) Get() interface{} {
+func (f *gsFlag) Get() any {
 	return *f.gs
 }
 
diff --git a/kythe/go/util/cmdutil/cmdutil.go b/kythe/go/util/cmdutil/cmdutil.go
index b417cf07a..a637baf01 100644
--- a/kythe/go/util/cmdutil/cmdutil.go
+++ b/kythe/go/util/cmdutil/cmdutil.go
@@ -60,13 +60,13 @@ func (i Info) SetFlags(*flag.FlagSet) {}
 
 // Execute implements part of subcommands.Command.
 // It prints the usage string to stdout and returns success.
-func (i Info) Execute(context.Context, *flag.FlagSet, ...interface{}) subcommands.ExitStatus {
+func (i Info) Execute(context.Context, *flag.FlagSet, ...any) subcommands.ExitStatus {
 	fmt.Print(i.usage) // the undecorated usage string
 	return subcommands.ExitSuccess
 }
 
 // Fail logs an error message and returns subcommands.ExitFailure.
-func (i Info) Fail(msg string, args ...interface{}) subcommands.ExitStatus {
+func (i Info) Fail(msg string, args ...any) subcommands.ExitStatus {
 	log.Output(1, fmt.Sprintf(msg, args...))
 	return subcommands.ExitFailure
 }
diff --git a/kythe/go/util/compare/compare.go b/kythe/go/util/compare/compare.go
index d5310c4ef..f2a2a883b 100644
--- a/kythe/go/util/compare/compare.go
+++ b/kythe/go/util/compare/compare.go
@@ -41,7 +41,7 @@ func (and) isOption() {}
 // With is an Option that provides a custom comparison function for the final
 // values being compared.  Only the last With Option passed to Compare will be
 // honored.
-type With func(a, b interface{}) Order
+type With func(a, b any) Order
 
 func (With) isOption() {}
 
@@ -55,7 +55,7 @@ func Reversed() Option { return reverseOrder{} }
 
 // By is an Option that transforms a value before performing a comparison.  It
 // should work on both sides of the comparison equivalently.
-type By func(interface{}) interface{}
+type By func(any) any
 
 func (By) isOption() {}
 
@@ -70,7 +70,7 @@ func (By) isOption() {}
 // a supported type or a With Option is provided for the types given.
 //
 // Note: this function panics if a and b are different types
-func Compare(a, b interface{}, opts ...Option) (o Order) {
+func Compare(a, b any, opts ...Option) (o Order) {
 	var reversed bool
 	defer func() {
 		if reversed {
@@ -126,7 +126,7 @@ func Compare(a, b interface{}, opts ...Option) (o Order) {
 //	Compare(a, b, By(someField)).AndThen(a, b, By(someOtherField))
 //
 //	Entries(e1, e2).AndThen(e1.FactValue, e2.FactValue)
-func (o Order) AndThen(a, b interface{}, opts ...Option) Order {
+func (o Order) AndThen(a, b any, opts ...Option) Order {
 	if o != EQ {
 		return o
 	}
@@ -137,7 +137,7 @@ func (o Order) AndThen(a, b interface{}, opts ...Option) Order {
 // Options.  If len(opts) == 0, Seq merely returns Compare(a, b).
 // For len(opts) > 0, Seq returns
 // Compare(a, b, opts[0]).AndThen(a, b, opts[1])....AndThen(a, b, opts[len(opts)-1]).
-func Seq(a, b interface{}, opts ...Option) Order {
+func Seq(a, b any, opts ...Option) Order {
 	if len(opts) == 0 {
 		return Compare(a, b)
 	}
@@ -209,19 +209,19 @@ func Bools(a, b bool) Order {
 
 // Options for comparing components of *spb.VName protobuf messages.
 var (
-	ByVNameSignature = By(func(x interface{}) interface{} {
+	ByVNameSignature = By(func(x any) any {
 		return x.(*spb.VName).GetSignature()
 	})
-	ByVNameCorpus = By(func(x interface{}) interface{} {
+	ByVNameCorpus = By(func(x any) any {
 		return x.(*spb.VName).GetCorpus()
 	})
-	ByVNameRoot = By(func(x interface{}) interface{} {
+	ByVNameRoot = By(func(x any) any {
 		return x.(*spb.VName).GetRoot()
 	})
-	ByVNamePath = By(func(x interface{}) interface{} {
+	ByVNamePath = By(func(x any) any {
 		return x.(*spb.VName).GetPath()
 	})
-	ByVNameLanguage = By(func(x interface{}) interface{} {
+	ByVNameLanguage = By(func(x any) any {
 		return x.(*spb.VName).GetLanguage()
 	})
 )
@@ -239,14 +239,14 @@ func VNamesEqual(v1, v2 *spb.VName) bool { return VNames(v1, v2) == EQ }
 
 // Options for comparing components of *spb.Entry protobuf messages.
 var (
-	ByEntrySource = And(By(func(x interface{}) interface{} {
+	ByEntrySource = And(By(func(x any) any {
 		return x.(*spb.Entry).GetSource()
-	}), With(func(a, b interface{}) Order { return VNames(a.(*spb.VName), b.(*spb.VName)) }))
-	ByEntryEdgeKind = By(func(x interface{}) interface{} { return x.(*spb.Entry).GetEdgeKind() })
-	ByEntryFactName = By(func(x interface{}) interface{} { return x.(*spb.Entry).GetFactName() })
-	ByEntryTarget   = And(By(func(x interface{}) interface{} {
+	}), With(func(a, b any) Order { return VNames(a.(*spb.VName), b.(*spb.VName)) }))
+	ByEntryEdgeKind = By(func(x any) any { return x.(*spb.Entry).GetEdgeKind() })
+	ByEntryFactName = By(func(x any) any { return x.(*spb.Entry).GetFactName() })
+	ByEntryTarget   = And(By(func(x any) any {
 		return x.(*spb.Entry).GetTarget()
-	}), With(func(a, b interface{}) Order { return VNames(a.(*spb.VName), b.(*spb.VName)) }))
+	}), With(func(a, b any) Order { return VNames(a.(*spb.VName), b.(*spb.VName)) }))
 )
 
 // Entries reports whether e1 is LT, GT, or EQ to e2 in entry order, ignoring
@@ -268,10 +268,10 @@ func (s ByEntries) Less(i, j int) bool { return Entries(s[i], s[j]) == LT }
 func (s ByEntries) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
 
 // Push implements part of the heap.Interface
-func (s *ByEntries) Push(v interface{}) { *s = append(*s, v.(*spb.Entry)) }
+func (s *ByEntries) Push(v any) { *s = append(*s, v.(*spb.Entry)) }
 
 // Pop implements part of the heap.Interface
-func (s *ByEntries) Pop() interface{} {
+func (s *ByEntries) Pop() any {
 	old := *s
 	n := len(old) - 1
 	out := old[n]
@@ -294,7 +294,7 @@ func EntriesEqual(e1, e2 *spb.Entry) bool { return ValueEntries(e1, e2) == EQ }
 // proto.Equal.
 //
 // See github.com/google/go-cmp/cmp for more details.
-func ProtoDiff(x, y interface{}, opts ...cmp.Option) string {
+func ProtoDiff(x, y any, opts ...cmp.Option) string {
 	return cmp.Diff(x, y, makeProtoOpts(opts)...)
 }
 
diff --git a/kythe/go/util/datasize/datasize.go b/kythe/go/util/datasize/datasize.go
index 47ae9f756..60edaf77a 100644
--- a/kythe/go/util/datasize/datasize.go
+++ b/kythe/go/util/datasize/datasize.go
@@ -41,7 +41,7 @@ func Flag(name, value, description string) *Size {
 }
 
 // Get implements part of the flag.Getter interface.
-func (f *sizeFlag) Get() interface{} {
+func (f *sizeFlag) Get() any {
 	return f.Size
 }
 
diff --git a/kythe/go/util/disksort/disksort.go b/kythe/go/util/disksort/disksort.go
index 27f901300..71578fb06 100644
--- a/kythe/go/util/disksort/disksort.go
+++ b/kythe/go/util/disksort/disksort.go
@@ -44,7 +44,7 @@ import (
 // the sorter are allowed.
 type Interface interface {
 	// Add adds a new element to the set of data to be sorted.
-	Add(i interface{}) error
+	Add(i any) error
 
 	// Iterator returns an Iterator to read each of the elements previously added
 	// to the set of data to be sorted.  Once Iterator is called, no more data may
@@ -56,14 +56,14 @@ type Interface interface {
 	// sorted.  If f returns an error, it is returned immediately and f is no
 	// longer called.  Once Read is called, no more data may be added to the
 	// sorter.  Iterator and Read may only be called once.
-	Read(f func(interface{}) error) error
+	Read(f func(any) error) error
 }
 
 // An Iterator reads each element, in order, in a sorted dataset.
 type Iterator interface {
 	// Next returns the next ordered element.  If none exist, an io.EOF error is
 	// returned.
-	Next() (interface{}, error)
+	Next() (any, error)
 
 	// Close releases all of the Iterator's used resources.  Each Iterator must be
 	// closed after the client's last call to Next or stray temporary files may be
@@ -75,16 +75,16 @@ type Iterator interface {
 // elements.
 type Marshaler interface {
 	// Marshal binary encodes the given element.
-	Marshal(interface{}) ([]byte, error)
+	Marshal(any) ([]byte, error)
 
 	// Unmarshal decodes the given encoding of an element.
-	Unmarshal([]byte) (interface{}, error)
+	Unmarshal([]byte) (any, error)
 }
 
 type mergeSorter struct {
 	opts MergeOptions
 
-	buffer  []interface{}
+	buffer  []any
 	workDir string
 	shards  []string
 
@@ -159,7 +159,7 @@ func NewMergeSorter(opts MergeOptions) (Interface, error) {
 
 	return &mergeSorter{
 		opts:    opts,
-		buffer:  make([]interface{}, 0, opts.MaxInMemory),
+		buffer:  make([]any, 0, opts.MaxInMemory),
 		workDir: dir,
 	}, nil
 }
@@ -171,7 +171,7 @@ var (
 )
 
 // Add implements part of the Interface interface.
-func (m *mergeSorter) Add(i interface{}) error {
+func (m *mergeSorter) Add(i any) error {
 	if m.finalized {
 		return ErrAlreadyFinalized
 	}
@@ -188,7 +188,7 @@ func (m *mergeSorter) Add(i interface{}) error {
 }
 
 type mergeIterator struct {
-	buffer []interface{}
+	buffer []any
 
 	merger    *sortutil.ByLesser
 	marshaler Marshaler
@@ -267,7 +267,7 @@ func (m *mergeSorter) Iterator() (iter Iterator, err error) {
 }
 
 // Next implements part of the Iterator interface.
-func (i *mergeIterator) Next() (interface{}, error) {
+func (i *mergeIterator) Next() (any, error) {
 	if i.merger == nil {
 		// Fast path for a single, in-memory shard
 		if len(i.buffer) == 0 {
@@ -335,7 +335,7 @@ func (i *mergeIterator) Close() error {
 }
 
 // Read implements part of the Interface interface.
-func (m *mergeSorter) Read(f func(i interface{}) error) (err error) {
+func (m *mergeSorter) Read(f func(i any) error) (err error) {
 	it, err := m.Iterator()
 	if err != nil {
 		return err
@@ -366,7 +366,7 @@ const shardFileMode = 0600 | os.ModeExclusive | os.ModeAppend | os.ModeTemporary
 
 func (m *mergeSorter) dumpShard() (err error) {
 	defer func() {
-		m.buffer = make([]interface{}, 0, m.opts.MaxInMemory)
+		m.buffer = make([]any, 0, m.opts.MaxInMemory)
 		m.bufferSize = 0
 	}()
 
@@ -422,7 +422,7 @@ func replaceErrIfNil(err *error, s string, newError error) {
 }
 
 type mergeElement struct {
-	el interface{}
+	el any
 	rd *delimited.Reader
 	f  *os.File
 }
@@ -430,7 +430,7 @@ type mergeElement struct {
 type mergeElementLesser struct{ sortutil.Lesser }
 
 // Less implements the sortutil.Lesser interface.
-func (m *mergeElementLesser) Less(a, b interface{}) bool {
+func (m *mergeElementLesser) Less(a, b any) bool {
 	x, y := a.(*mergeElement), b.(*mergeElement)
 	return m.Lesser.Less(x.el, y.el)
 }
diff --git a/kythe/go/util/flagutil/flagutil.go b/kythe/go/util/flagutil/flagutil.go
index cf1008a60..df31321c0 100644
--- a/kythe/go/util/flagutil/flagutil.go
+++ b/kythe/go/util/flagutil/flagutil.go
@@ -74,7 +74,7 @@ func UsageError(msg string) {
 
 // UsageErrorf prints str formatted with the given vals to stderr, calls
 // flag.Usage, and exits the program unsuccessfully.
-func UsageErrorf(str string, vals ...interface{}) {
+func UsageErrorf(str string, vals ...any) {
 	UsageError(fmt.Sprintf(str, vals...))
 }
 
@@ -96,7 +96,7 @@ func (f *StringList) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *StringList) Get() interface{} {
+func (f *StringList) Get() any {
 	if f == nil {
 		return []string(nil)
 	}
@@ -136,7 +136,7 @@ func (f *StringSet) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *StringSet) Get() interface{} {
+func (f *StringSet) Get() any {
 	if f == nil {
 		return stringset.Set(nil)
 	}
@@ -184,7 +184,7 @@ func (f *StringMultimap) String() string {
 }
 
 // Get implements flag.Getter and returns a slice of string values.
-func (f *StringMultimap) Get() interface{} {
+func (f *StringMultimap) Get() any {
 	if f == nil {
 		return map[string]stringset.Set(nil)
 	}
diff --git a/kythe/go/util/formatjson/formatjson.go b/kythe/go/util/formatjson/formatjson.go
index 37088e37a..d583d59a8 100644
--- a/kythe/go/util/formatjson/formatjson.go
+++ b/kythe/go/util/formatjson/formatjson.go
@@ -25,7 +25,7 @@ import (
 )
 
 func main() {
-	obj := make(map[string]interface{})
+	obj := make(map[string]any)
 	d := json.NewDecoder(os.Stdin)
 	if err := d.Decode(&obj); err != nil {
 		log.Fatal(err)
diff --git a/kythe/go/util/keys/keys.go b/kythe/go/util/keys/keys.go
index 2b3553ab9..315a5908f 100644
--- a/kythe/go/util/keys/keys.go
+++ b/kythe/go/util/keys/keys.go
@@ -35,8 +35,8 @@ import (
 //   - bool
 //
 // More detail at: https://godoc.org/github.com/google/orderedcode#Append
-func Append(key []byte, items ...interface{}) ([]byte, error) {
-	expanded := make([]interface{}, 0, len(items))
+func Append(key []byte, items ...any) ([]byte, error) {
+	expanded := make([]any, 0, len(items))
 	for _, item := range items {
 		switch x := item.(type) {
 		case *spb.VName:
@@ -75,9 +75,9 @@ func Append(key []byte, items ...interface{}) ([]byte, error) {
 //   - bool
 //
 // More detail at: https://godoc.org/github.com/google/orderedcode#Parse
-func Parse(key string, items ...interface{}) (remaining string, err error) {
+func Parse(key string, items ...any) (remaining string, err error) {
 	// See Append implementation for details
-	expanded := make([]interface{}, 0, len(items))
+	expanded := make([]any, 0, len(items))
 	for _, item := range items {
 		switch x := item.(type) {
 		case *spb.VName:
diff --git a/kythe/go/util/pager/pager.go b/kythe/go/util/pager/pager.go
index 456ee930d..cf45ded6f 100644
--- a/kythe/go/util/pager/pager.go
+++ b/kythe/go/util/pager/pager.go
@@ -29,13 +29,13 @@ import (
 )
 
 // A Head signals the start of a new Set.
-type Head interface{}
+type Head any
 
 // A Group is part of a Set.
-type Group interface{}
+type Group any
 
 // A Set is a set of Groups.
-type Set interface{}
+type Set any
 
 // SetPager constructs a set of Sets and Pages from a sequence of Heads and
 // Groups.  For each set of Groups with the same Head, a call to StartSet must
@@ -97,7 +97,7 @@ func (p *SetPager) StartSet(ctx context.Context, hd Head) error {
 
 	p.curSet = p.NewSet(hd)
 	p.groups = &sortutil.ByLesser{
-		Lesser: sortutil.LesserFunc(func(a, b interface{}) bool {
+		Lesser: sortutil.LesserFunc(func(a, b any) bool {
 			// Sort larger Groups first.
 			return p.Size(a) > p.Size(b)
 		}),
diff --git a/kythe/go/util/reduce/reduce.go b/kythe/go/util/reduce/reduce.go
index 649ddbaec..fd88f0265 100644
--- a/kythe/go/util/reduce/reduce.go
+++ b/kythe/go/util/reduce/reduce.go
@@ -49,12 +49,12 @@ func (r Func) Reduce(ctx context.Context, io IO) error { return r(ctx, io) }
 
 // A Input yields input to a Reducer.
 type Input interface {
-	Next() (interface{}, error)
+	Next() (any, error)
 }
 
 // A Output allows a Reducer to emit values.
 type Output interface {
-	Emit(context.Context, interface{}) error
+	Emit(context.Context, any) error
 }
 
 // IO composes Input and Output.
@@ -64,16 +64,16 @@ type IO interface {
 }
 
 // An OutFunc implements the Output interface.
-type OutFunc func(context.Context, interface{}) error
+type OutFunc func(context.Context, any) error
 
 // Emit implements the Output interface.
-func (o OutFunc) Emit(ctx context.Context, i interface{}) error { return o(ctx, i) }
+func (o OutFunc) Emit(ctx context.Context, i any) error { return o(ctx, i) }
 
 // An InFunc implements the Input interface.
-type InFunc func(context.Context) (interface{}, error)
+type InFunc func(context.Context) (any, error)
 
 // Next implements the Input interface.
-func (f InFunc) Next(ctx context.Context) (interface{}, error) { return f(ctx) }
+func (f InFunc) Next(ctx context.Context) (any, error) { return f(ctx) }
 
 // ChannelInput implements the Input interface, yielding each channel
 // value when Next is called.
@@ -81,12 +81,12 @@ type ChannelInput <-chan ChannelInputValue
 
 // ChannelInputValue represents the return value of Input#Next.
 type ChannelInputValue struct {
-	Value interface{}
+	Value any
 	Err   error
 }
 
 // Next implements the Input interface.
-func (c ChannelInput) Next() (interface{}, error) {
+func (c ChannelInput) Next() (any, error) {
 	v, ok := <-c
 	if !ok {
 		return nil, io.EOF
diff --git a/kythe/go/util/reduce/reduce_sort.go b/kythe/go/util/reduce/reduce_sort.go
index 92106cde4..af0a214a1 100644
--- a/kythe/go/util/reduce/reduce_sort.go
+++ b/kythe/go/util/reduce/reduce_sort.go
@@ -68,7 +68,7 @@ func Sort(ctx context.Context, splits SplitInput, r Reducer) (SplitInput, error)
 		return nil, err
 	}
 
-	addToSorter := OutFunc(func(_ context.Context, i interface{}) error {
+	addToSorter := OutFunc(func(_ context.Context, i any) error {
 		_, ok := i.(*ipb.SortedKeyValue)
 		if !ok {
 			return fmt.Errorf("given non-SortedKeyValue: %T", i)
@@ -116,7 +116,7 @@ type sortSplitInput struct {
 	endOfSplit bool
 }
 
-func (s *sortSplitInput) Next() (interface{}, error) {
+func (s *sortSplitInput) Next() (any, error) {
 	if s.endOfSplit {
 		return nil, io.EOF
 	} else if s.first != nil {
@@ -154,7 +154,7 @@ func (s *sortSplitInput) NextSplit() (Input, error) {
 
 type keyValueSortUtil struct{}
 
-func (keyValueSortUtil) Less(a, b interface{}) bool {
+func (keyValueSortUtil) Less(a, b any) bool {
 	x, y := a.(*ipb.SortedKeyValue), b.(*ipb.SortedKeyValue)
 	if x.Key == y.Key {
 		return x.SortKey < y.SortKey
@@ -162,11 +162,11 @@ func (keyValueSortUtil) Less(a, b interface{}) bool {
 	return x.Key < y.Key
 }
 
-func (keyValueSortUtil) Marshal(x interface{}) ([]byte, error) {
+func (keyValueSortUtil) Marshal(x any) ([]byte, error) {
 	return proto.Marshal(x.(proto.Message))
 }
 
-func (keyValueSortUtil) Unmarshal(rec []byte) (interface{}, error) {
+func (keyValueSortUtil) Unmarshal(rec []byte) (any, error) {
 	var kv ipb.SortedKeyValue
 	return &kv, proto.Unmarshal(rec, &kv)
 }
diff --git a/kythe/go/util/schema/mkdata/mkdata.go b/kythe/go/util/schema/mkdata/mkdata.go
index 577ab5dd8..2f59e0336 100644
--- a/kythe/go/util/schema/mkdata/mkdata.go
+++ b/kythe/go/util/schema/mkdata/mkdata.go
@@ -254,14 +254,14 @@ var u32 = reflect.TypeOf(uint32(0))
 // a type convertible to uint32 (e.g., a proto enumeration).  This function
 // will panic if v does not have an appropriate concrete type.  The concrete
 // type of each returned element remains X (not uint32).
-func sortedKeys(v interface{}) []interface{} {
+func sortedKeys(v any) []any {
 	keys := reflect.ValueOf(v).MapKeys()
 	sort.Slice(keys, func(i, j int) bool {
 		a := keys[i].Convert(u32).Interface().(uint32)
 		b := keys[j].Convert(u32).Interface().(uint32)
 		return a < b
 	})
-	vals := make([]interface{}, len(keys))
+	vals := make([]any, len(keys))
 	for i, key := range keys {
 		vals[i] = key.Interface()
 	}
diff --git a/kythe/go/util/sortutil/sortutil.go b/kythe/go/util/sortutil/sortutil.go
index b7e8cec94..7180c3db6 100644
--- a/kythe/go/util/sortutil/sortutil.go
+++ b/kythe/go/util/sortutil/sortutil.go
@@ -22,11 +22,11 @@ import "sort"
 // Lesser is an interface to a comparison function.
 type Lesser interface {
 	// Less returns true if a < b.
-	Less(a, b interface{}) bool
+	Less(a, b any) bool
 }
 
 // Sort uses l to sort the given slice.
-func Sort(l Lesser, a []interface{}) {
+func Sort(l Lesser, a []any) {
 	sort.Sort(&ByLesser{
 		Lesser: l,
 		Slice:  a,
@@ -36,7 +36,7 @@ func Sort(l Lesser, a []interface{}) {
 // ByLesser implements the heap.Interface using a Lesser over a slice.
 type ByLesser struct {
 	Lesser Lesser
-	Slice  []interface{}
+	Slice  []any
 }
 
 // Clear removes all elements from the underlying slice.
@@ -52,10 +52,10 @@ func (s ByLesser) Swap(i, j int) { s.Slice[i], s.Slice[j] = s.Slice[j], s.Slice[
 func (s ByLesser) Less(i, j int) bool { return s.Lesser.Less(s.Slice[i], s.Slice[j]) }
 
 // Push implements part of the heap.Interface
-func (s *ByLesser) Push(v interface{}) { s.Slice = append(s.Slice, v) }
+func (s *ByLesser) Push(v any) { s.Slice = append(s.Slice, v) }
 
 // Pop implements part of the heap.Interface
-func (s *ByLesser) Pop() interface{} {
+func (s *ByLesser) Pop() any {
 	n := len(s.Slice) - 1
 	out := s.Slice[n]
 	s.Slice = s.Slice[:n]
@@ -64,7 +64,7 @@ func (s *ByLesser) Pop() interface{} {
 
 // Peek returns the least element in the heap.  nil is returned if the heap is
 // empty.
-func (s ByLesser) Peek() interface{} {
+func (s ByLesser) Peek() any {
 	if len(s.Slice) == 0 {
 		return nil
 	}
@@ -72,7 +72,7 @@ func (s ByLesser) Peek() interface{} {
 }
 
 // LesserFunc implements the Lesser interface using a function.
-type LesserFunc func(a, b interface{}) bool
+type LesserFunc func(a, b any) bool
 
 // Less implements the Lesser interface.
-func (f LesserFunc) Less(a, b interface{}) bool { return f(a, b) }
+func (f LesserFunc) Less(a, b any) bool { return f(a, b) }
diff --git a/kythe/go/util/tools/print_extra_action/print_extra_action.go b/kythe/go/util/tools/print_extra_action/print_extra_action.go
index 283e80ea6..b1a896474 100644
--- a/kythe/go/util/tools/print_extra_action/print_extra_action.go
+++ b/kythe/go/util/tools/print_extra_action/print_extra_action.go
@@ -61,7 +61,7 @@ func main() {
 		log.Fatal(err)
 	}
 
-	obj := make(map[string]interface{})
+	obj := make(map[string]any)
 	obj["extra_action_info"] = &xa
 
 	xs, err := proto.GetExtensions(&xa, knownExtensions)
@@ -69,7 +69,7 @@ func main() {
 		log.Fatal(err)
 	}
 
-	var extensions []interface{}
+	var extensions []any
 	for _, e := range xs {
 		if e != nil {
 			extensions = append(extensions, e)
diff --git a/kythe/go/util/tools/scan_leveldb/scan_leveldb.go b/kythe/go/util/tools/scan_leveldb/scan_leveldb.go
index 3c15ec50c..044b8139a 100644
--- a/kythe/go/util/tools/scan_leveldb/scan_leveldb.go
+++ b/kythe/go/util/tools/scan_leveldb/scan_leveldb.go
@@ -102,7 +102,7 @@ func main() {
 					log.Fatalf("Error during scan of %q: %v", path, err)
 				}
 
-				var k, v interface{}
+				var k, v any
 
 				if protoValueType == nil {
 					if *stringKey {
@@ -138,6 +138,6 @@ func main() {
 }
 
 type keyValue struct {
-	Key   interface{} `json:"key"`
-	Value interface{} `json:"value"`
+	Key   any `json:"key"`
+	Value any `json:"value"`
 }
diff --git a/kythe/go/util/tools/vnames/apply.go b/kythe/go/util/tools/vnames/apply.go
index 2e2b7a44f..464a0149a 100644
--- a/kythe/go/util/tools/vnames/apply.go
+++ b/kythe/go/util/tools/vnames/apply.go
@@ -60,7 +60,7 @@ func (c *applyRulesCmd) SetFlags(flag *flag.FlagSet) {
 	flag.StringVar(&c.format, "format", string(jsonFormat), `Path of VName rewrite rules file {"JSON", "PROTO"}`)
 	flag.BoolVar(&c.allowEmpty, "allow_empty", false, "Whether to write an empty VName when no rule matches the input")
 }
-func (c *applyRulesCmd) Execute(ctx context.Context, flag *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (c *applyRulesCmd) Execute(ctx context.Context, flag *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	rules, err := rulesFormat(strings.ToUpper(c.format)).readFile(ctx, c.rulesPath)
 	if err != nil {
 		return cmdErrorf("reading %q: %v", c.rulesPath, err)
@@ -129,7 +129,7 @@ func (f rulesFormat) writeRules(rules vnameutil.Rules, w io.Writer) error {
 	}
 }
 
-func cmdErrorf(msg string, args ...interface{}) subcommands.ExitStatus {
+func cmdErrorf(msg string, args ...any) subcommands.ExitStatus {
 	log.Errorf(msg, args...)
 	return subcommands.ExitFailure
 }
diff --git a/kythe/go/util/tools/vnames/convert.go b/kythe/go/util/tools/vnames/convert.go
index 3530bf5e8..031eaac6b 100644
--- a/kythe/go/util/tools/vnames/convert.go
+++ b/kythe/go/util/tools/vnames/convert.go
@@ -45,7 +45,7 @@ func (c *convertRulesCmd) SetFlags(flag *flag.FlagSet) {
 	flag.StringVar(&c.toFormat, "to", "", "Target format of VName rewrite rules")
 	flag.StringVar(&c.outputPath, "output", "", "Output path to write converted VName rewrite rules (default: write to stdout)")
 }
-func (c *convertRulesCmd) Execute(ctx context.Context, flag *flag.FlagSet, args ...interface{}) subcommands.ExitStatus {
+func (c *convertRulesCmd) Execute(ctx context.Context, flag *flag.FlagSet, args ...any) subcommands.ExitStatus {
 	if c.fromFormat == "" {
 		return cmdErrorf("--from <format> must be specified")
 	} else if c.toFormat == "" {


Test patch:
diff --git a/kythe/go/indexer/testdata/code/methdecl.go b/kythe/go/indexer/testdata/code/methdecl.go
index e04c50970..7e467065c 100644
--- a/kythe/go/indexer/testdata/code/methdecl.go
+++ b/kythe/go/indexer/testdata/code/methdecl.go
@@ -67,7 +67,7 @@ func (rec *w) LessThan(x int) bool {
 }
 
 type decorCommand struct{}
-type Context interface{}
+type Context any
 type FlagSet struct{}
 type API struct{}
 
diff --git a/kythe/go/platform/analysis/proxy/proxy_test.go b/kythe/go/platform/analysis/proxy/proxy_test.go
index ffb4ab704..a36178b33 100644
--- a/kythe/go/platform/analysis/proxy/proxy_test.go
+++ b/kythe/go/platform/analysis/proxy/proxy_test.go
@@ -37,8 +37,8 @@ import (
 
 // A testreq is the equivalent of a request, pre-encoding.
 type testreq struct {
-	Type string      `json:"req,omitempty"`
-	Args interface{} `json:"args,omitempty"`
+	Type string `json:"req,omitempty"`
+	Args any    `json:"args,omitempty"`
 }
 
 // An indexer simulates an indexer process. It sends each of the requests in
@@ -163,7 +163,7 @@ var (
 const analysisReply = `{"rsp":"ok","args":{"fds":"Q","rev":"1","unit":{"v_name":{"signature":"test"}}}}`
 const analysisWireReply = `{"rsp":"ok","args":{"fds":"Q","rev":"1","unit":"CgYKBHRlc3Q="}}`
 
-func mustMarshal(v interface{}) string {
+func mustMarshal(v any) string {
 	bits, err := json.Marshal(v)
 	if err != nil {
 		log.Fatalf("Error marshaling JSON: %v", err)
diff --git a/kythe/go/platform/kcd/kythe/units_test.go b/kythe/go/platform/kcd/kythe/units_test.go
index 525526c33..79a67d0d0 100644
--- a/kythe/go/platform/kcd/kythe/units_test.go
+++ b/kythe/go/platform/kcd/kythe/units_test.go
@@ -97,7 +97,7 @@ func TestCanonicalization(t *testing.T) {
 	unit.Canonicalize()
 	tests := []struct {
 		name  string
-		value interface{}
+		value any
 	}{
 		{"required inputs", unit.Proto.RequiredInput},
 		{"source files", unit.Proto.SourceFile},
@@ -156,7 +156,7 @@ func TestLookupVName(t *testing.T) {
 	}
 }
 
-func keys(v interface{}) (keys []string) {
+func keys(v any) (keys []string) {
 	switch t := v.(type) {
 	case []*apb.CompilationUnit_FileInput:
 		for _, input := range t {
diff --git a/kythe/go/platform/kzip/info/info_test.go b/kythe/go/platform/kzip/info/info_test.go
index 6a37fd355..bc77bab60 100644
--- a/kythe/go/platform/kzip/info/info_test.go
+++ b/kythe/go/platform/kzip/info/info_test.go
@@ -126,7 +126,7 @@ func TestMergeKzipInfo(t *testing.T) {
 		CriticalKzipErrors: []string{"foo.py doesn't have a required_input", "foo2.py doesn't have a required_input"},
 		Size:               40,
 	}
-	wantTotal := apb.KzipInfo_CorpusInfo{
+	wantTotal := &apb.KzipInfo_CorpusInfo{
 		LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 			"python": {
 				Count: 12,
@@ -153,7 +153,7 @@ func TestMergeKzipInfo(t *testing.T) {
 	if diff := compare.ProtoDiff(got, want); diff != "" {
 		t.Errorf("Merged kzips don't match: (-: found, +: expected)\n%s", diff)
 	}
-	if diff := compare.ProtoDiff(&gotTotal, &wantTotal); diff != "" {
+	if diff := compare.ProtoDiff(gotTotal, wantTotal); diff != "" {
 		t.Errorf("got %v, want %v", gotTotal, wantTotal)
 		t.Errorf("Merged kzips don't match: (-: found, +: expected)\n%s", diff)
 	}
diff --git a/kythe/go/util/compare/compare_test.go b/kythe/go/util/compare/compare_test.go
index 220967205..c7c37a8e1 100644
--- a/kythe/go/util/compare/compare_test.go
+++ b/kythe/go/util/compare/compare_test.go
@@ -25,7 +25,7 @@ import (
 
 func TestCompare(t *testing.T) {
 	tests := []struct {
-		a, b     interface{}
+		a, b     any
 		opts     []Option
 		expected Order
 	}{
diff --git a/kythe/go/util/disksort/disksort_test.go b/kythe/go/util/disksort/disksort_test.go
index d86877e29..af9087a3b 100644
--- a/kythe/go/util/disksort/disksort_test.go
+++ b/kythe/go/util/disksort/disksort_test.go
@@ -26,17 +26,17 @@ import (
 type numLesser struct{}
 
 // Less implements the Lesser interface.
-func (numLesser) Less(a, b interface{}) bool { return a.(int) < b.(int) }
+func (numLesser) Less(a, b any) bool { return a.(int) < b.(int) }
 
 type numMarshaler struct{}
 
 // Marshal implements part of the Marshaler interface.
-func (numMarshaler) Marshal(x interface{}) ([]byte, error) {
+func (numMarshaler) Marshal(x any) ([]byte, error) {
 	return []byte(strconv.Itoa(x.(int))), nil
 }
 
 // Unmarshal implements part of the Marshaler interface.
-func (numMarshaler) Unmarshal(rec []byte) (interface{}, error) {
+func (numMarshaler) Unmarshal(rec []byte) (any, error) {
 	return strconv.Atoi(string(rec))
 }
 
@@ -74,7 +74,7 @@ func TestMergeSorter(t *testing.T) {
 	}
 
 	var expected int
-	if err := sorter.Read(func(i interface{}) error {
+	if err := sorter.Read(func(i any) error {
 		x, ok := i.(int)
 		if !ok {
 			return fmt.Errorf("expected int; found %T", i)
diff --git a/kythe/go/util/reduce/reduce_test.go b/kythe/go/util/reduce/reduce_test.go
index c4f86b722..51a06139a 100644
--- a/kythe/go/util/reduce/reduce_test.go
+++ b/kythe/go/util/reduce/reduce_test.go
@@ -29,7 +29,7 @@ import (
 
 var ctx = context.Background()
 
-func testSplitInput(splits ...[]interface{}) SplitInput {
+func testSplitInput(splits ...[]any) SplitInput {
 	ch := make(chan ChannelSplitInputValue, len(splits))
 	for _, s := range splits {
 		in := make(chan ChannelInputValue, len(s))
@@ -43,8 +43,8 @@ func testSplitInput(splits ...[]interface{}) SplitInput {
 	return ChannelSplitInput(ch)
 }
 
-func testReadInput(splits SplitInput) [][]interface{} {
-	var ss [][]interface{}
+func testReadInput(splits SplitInput) [][]any {
+	var ss [][]any
 	for {
 		ri, err := splits.NextSplit()
 		if err == io.EOF {
@@ -53,7 +53,7 @@ func testReadInput(splits SplitInput) [][]interface{} {
 			panic(err)
 		}
 
-		var s []interface{}
+		var s []any
 		for {
 			i, err := ri.Next()
 			if err == io.EOF {
@@ -69,7 +69,7 @@ func testReadInput(splits SplitInput) [][]interface{} {
 }
 
 func TestSort(t *testing.T) {
-	sorted, err := Sort(ctx, testSplitInput([]interface{}{1, 2, 3}, []interface{}{1, 5, 6}), Func(func(ctx context.Context, rio IO) error {
+	sorted, err := Sort(ctx, testSplitInput([]any{1, 2, 3}, []any{1, 5, 6}), Func(func(ctx context.Context, rio IO) error {
 		var sum int
 		for {
 			i, err := rio.Next()
@@ -91,7 +91,7 @@ func TestSort(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	expected := [][]interface{}{
+	expected := [][]any{
 		{&ipb.SortedKeyValue{
 			Key:   "12",
 			Value: []byte("12"),
diff --git a/kythe/go/util/riegeli/riegeli_test.go b/kythe/go/util/riegeli/riegeli_test.go
index 05e025244..78e311780 100644
--- a/kythe/go/util/riegeli/riegeli_test.go
+++ b/kythe/go/util/riegeli/riegeli_test.go
@@ -388,8 +388,7 @@ func TestRecordsMetadata(t *testing.T) {
 		Transpose:   true,
 		Compression: BrotliCompression(4),
 	}
-	expected := rmpb.RecordsMetadata{}
-	expected.RecordWriterOptions = proto.String(opts.String())
+	expected := &rmpb.RecordsMetadata{RecordWriterOptions: proto.String(opts.String())}
 
 	buf := writeStrings(t, opts, 128)
 	rd := NewReader(bytes.NewReader(buf.Bytes()))
diff --git a/kythe/go/util/vnameutil/test/test_vname_rules.go b/kythe/go/util/vnameutil/test/test_vname_rules.go
index 9b7c86ccd..63209d3f3 100644
--- a/kythe/go/util/vnameutil/test/test_vname_rules.go
+++ b/kythe/go/util/vnameutil/test/test_vname_rules.go
@@ -59,7 +59,7 @@ func (t test) vname() *spb.VName {
 	}
 }
 
-func errorf(msg string, args ...interface{}) {
+func errorf(msg string, args ...any) {
 	numErrs++
 	log.Errorf(msg, args...)
 }