diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-12-19 12:52:30 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-12-22 02:13:00 +0000 |
| commit | a83befa0d111a0ba6fac52d763e93c76a2ef94d4 (patch) | |
| tree | 7d3c28b24229429936a631e8ceb24135856b257d /pkg/compiler | |
| parent | 8fb7048c5117ccb592deb5e8e4a62027e6d399cf (diff) | |
all: use any instead of interface{}
Any is the preferred over interface{} now in Go.
Diffstat (limited to 'pkg/compiler')
| -rw-r--r-- | pkg/compiler/compiler.go | 4 | ||||
| -rw-r--r-- | pkg/compiler/const_file.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 3022def7f..7b22cef42 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -148,12 +148,12 @@ type warn struct { msg string } -func (comp *compiler) error(pos ast.Pos, msg string, args ...interface{}) { +func (comp *compiler) error(pos ast.Pos, msg string, args ...any) { comp.errors++ comp.eh(pos, fmt.Sprintf(msg, args...)) } -func (comp *compiler) warning(pos ast.Pos, msg string, args ...interface{}) { +func (comp *compiler) warning(pos ast.Pos, msg string, args ...any) { comp.warnings = append(comp.warnings, warn{pos, fmt.Sprintf(msg, args...)}) } diff --git a/pkg/compiler/const_file.go b/pkg/compiler/const_file.go index 0220da555..620c73f7b 100644 --- a/pkg/compiler/const_file.go +++ b/pkg/compiler/const_file.go @@ -204,7 +204,7 @@ func DeserializeConstFile(glob string, eh ast.ErrorHandler) *ConstFile { func (cf *ConstFile) deserializeFile(data []byte, file, arch string, eh ast.ErrorHandler) bool { pos := ast.Pos{File: file, Line: 1} - errf := func(msg string, args ...interface{}) bool { + errf := func(msg string, args ...any) bool { eh(pos, fmt.Sprintf(msg, args...)) return false } @@ -247,7 +247,7 @@ func (cf *ConstFile) deserializeFile(data []byte, file, arch string, eh ast.Erro return true } -type errft func(msg string, args ...interface{}) bool +type errft func(msg string, args ...any) bool func (cf *ConstFile) parseConst(arches []string, name, line string, weak bool, errf errft) bool { var dflt map[string]uint64 |
