Skip to content

Commit 2bc731c

Browse files
committed
Run gofmt -w -r 'interface{} -> any' src to support go 1.18.
1 parent f543573 commit 2bc731c

37 files changed

+103
-103
lines changed

src/device/arm/arm.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ func Asm(asm string)
5555
//
5656
// You can use {} in the asm string (which expands to a register) to set the
5757
// return value.
58-
func AsmFull(asm string, regs map[string]interface{}) uintptr
58+
func AsmFull(asm string, regs map[string]any) uintptr
5959

6060
// Run the following system call (SVCall) with 0 arguments.
6161
func SVCall0(num uintptr) uintptr
6262

6363
// Run the following system call (SVCall) with 1 argument.
64-
func SVCall1(num uintptr, a1 interface{}) uintptr
64+
func SVCall1(num uintptr, a1 any) uintptr
6565

6666
// Run the following system call (SVCall) with 2 arguments.
67-
func SVCall2(num uintptr, a1, a2 interface{}) uintptr
67+
func SVCall2(num uintptr, a1, a2 any) uintptr
6868

6969
// Run the following system call (SVCall) with 3 arguments.
70-
func SVCall3(num uintptr, a1, a2, a3 interface{}) uintptr
70+
func SVCall3(num uintptr, a1, a2, a3 any) uintptr
7171

7272
// Run the following system call (SVCall) with 4 arguments.
73-
func SVCall4(num uintptr, a1, a2, a3, a4 interface{}) uintptr
73+
func SVCall4(num uintptr, a1, a2, a3, a4 any) uintptr
7474

7575
const (
7676
SCS_BASE = 0xE000E000
@@ -184,7 +184,7 @@ func DisableInterrupts() uintptr {
184184
// EnableInterrupts enables all interrupts again. The value passed in must be
185185
// the mask returned by DisableInterrupts.
186186
func EnableInterrupts(mask uintptr) {
187-
AsmFull("msr PRIMASK, {mask}", map[string]interface{}{
187+
AsmFull("msr PRIMASK, {mask}", map[string]any{
188188
"mask": mask,
189189
})
190190
}

src/device/arm64/arm64.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ func Asm(asm string)
1818
//
1919
// You can use {} in the asm string (which expands to a register) to set the
2020
// return value.
21-
func AsmFull(asm string, regs map[string]interface{}) uintptr
21+
func AsmFull(asm string, regs map[string]any) uintptr
2222

2323
// Run the following system call (SVCall) with 0 arguments.
2424
func SVCall0(num uintptr) uintptr
2525

2626
// Run the following system call (SVCall) with 1 argument.
27-
func SVCall1(num uintptr, a1 interface{}) uintptr
27+
func SVCall1(num uintptr, a1 any) uintptr
2828

2929
// Run the following system call (SVCall) with 2 arguments.
30-
func SVCall2(num uintptr, a1, a2 interface{}) uintptr
30+
func SVCall2(num uintptr, a1, a2 any) uintptr
3131

3232
// Run the following system call (SVCall) with 3 arguments.
33-
func SVCall3(num uintptr, a1, a2, a3 interface{}) uintptr
33+
func SVCall3(num uintptr, a1, a2, a3 any) uintptr
3434

3535
// Run the following system call (SVCall) with 4 arguments.
36-
func SVCall4(num uintptr, a1, a2, a3, a4 interface{}) uintptr
36+
func SVCall4(num uintptr, a1, a2, a3, a4 any) uintptr

src/device/asm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ func Asm(asm string)
1818
//
1919
// You can use {} in the asm string (which expands to a register) to set the
2020
// return value.
21-
func AsmFull(asm string, regs map[string]interface{}) uintptr
21+
func AsmFull(asm string, regs map[string]any) uintptr

src/device/avr/avr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ func Asm(asm string)
1818
//
1919
// You can use {} in the asm string (which expands to a register) to set the
2020
// return value.
21-
func AsmFull(asm string, regs map[string]interface{}) uintptr
21+
func AsmFull(asm string, regs map[string]any) uintptr

src/device/riscv/riscv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func Asm(asm string)
1818
//
1919
// You can use {} in the asm string (which expands to a register) to set the
2020
// return value.
21-
func AsmFull(asm string, regs map[string]interface{}) uintptr
21+
func AsmFull(asm string, regs map[string]any) uintptr
2222

2323
// DisableInterrupts disables all interrupts, and returns the old interrupt
2424
// state.

src/examples/test/test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func main() {
7070
printItf(Number(3))
7171
s := Stringer(thing)
7272
println("Stringer.String():", s.String())
73-
var itf interface{} = s
73+
var itf any = s
7474
println("Stringer.(*Thing).String():", itf.(Stringer).String())
7575

7676
// unusual calls
@@ -124,7 +124,7 @@ func strlen(s string) int {
124124
return len(s)
125125
}
126126

127-
func printItf(val interface{}) {
127+
func printItf(val any) {
128128
switch val := val.(type) {
129129
case Doubler:
130130
println("is Doubler:", val.Double())

src/examples/wasm/callback/wasm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
}
1616

1717
func updater(n *int) js.Func {
18-
return js.FuncOf(func(this js.Value, args []js.Value) interface{} {
18+
return js.FuncOf(func(this js.Value, args []js.Value) any {
1919
*n, _ = strconv.Atoi(this.Get("value").String())
2020
update()
2121
return nil

src/examples/wasm/invoke/wasm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"syscall/js"
55
)
66

7-
func runner(this js.Value, args []js.Value) interface{} {
7+
func runner(this js.Value, args []js.Value) any {
88
return args[0].Invoke(args[1]).String()
99
}
1010

src/examples/wasm/slices/wasm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"syscall/js"
66
)
77

8-
func splitter(this js.Value, args []js.Value) interface{} {
8+
func splitter(this js.Value, args []js.Value) any {
99
values := strings.Split(args[0].String(), ",")
1010

11-
result := make([]interface{}, 0)
11+
result := make([]any, 0)
1212
for _, each := range values {
1313
result = append(result, each)
1414
}

src/internal/reflectlite/reflect.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package reflectlite
22

33
import "reflect"
44

5-
func Swapper(slice interface{}) func(i, j int) {
5+
func Swapper(slice any) func(i, j int) {
66
return reflect.Swapper(slice)
77
}
88

@@ -40,11 +40,11 @@ const (
4040
UnsafePointer Kind = reflect.UnsafePointer
4141
)
4242

43-
func ValueOf(i interface{}) reflect.Value {
43+
func ValueOf(i any) reflect.Value {
4444
return reflect.ValueOf(i)
4545
}
4646

47-
func TypeOf(i interface{}) reflect.Type {
47+
func TypeOf(i any) reflect.Type {
4848
return reflect.TypeOf(i)
4949
}
5050

0 commit comments

Comments
 (0)