aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-12-19 12:52:30 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-12-22 02:13:00 +0000
commita83befa0d111a0ba6fac52d763e93c76a2ef94d4 (patch)
tree7d3c28b24229429936a631e8ceb24135856b257d /prog/encoding.go
parent8fb7048c5117ccb592deb5e8e4a62027e6d399cf (diff)
all: use any instead of interface{}
Any is the preferred over interface{} now in Go.
Diffstat (limited to 'prog/encoding.go')
-rw-r--r--prog/encoding.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index 3bae29316..c468bd79e 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -74,7 +74,7 @@ func (ctx *serializer) print(text string) {
ctx.printf("%v", text)
}
-func (ctx *serializer) printf(text string, args ...interface{}) {
+func (ctx *serializer) printf(text string, args ...any) {
fmt.Fprintf(ctx.buf, text, args...)
}
@@ -820,7 +820,7 @@ func (p *parser) parseArgUnion(typ Type, dir Dir) (Arg, error) {
}
// Eats excessive call arguments and struct fields to recover after description changes.
-func (p *parser) eatExcessive(stopAtComma bool, what string, args ...interface{}) {
+func (p *parser) eatExcessive(stopAtComma bool, what string, args ...any) {
p.strictFailf(what, args...)
paren, brack, brace := 0, 0, 0
for !p.EOF() && p.e == nil {
@@ -1286,14 +1286,14 @@ func (p *parser) Ident() string {
return s
}
-func (p *parser) failf(msg string, args ...interface{}) {
+func (p *parser) failf(msg string, args ...any) {
if p.e == nil {
p.e = fmt.Errorf("%v\nline #%v:%v: %v", fmt.Sprintf(msg, args...), p.l, p.i,
highlightError(p.s, p.i))
}
}
-func (p *parser) strictFailf(msg string, args ...interface{}) {
+func (p *parser) strictFailf(msg string, args ...any) {
if p.strict {
p.failf(msg, args...)
}