mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
*: replace interface{}
with any
keyword
Everywhere including examples, external interop APIs, bindings generators code and in other valuable places. A couple of `interface{}` usages are intentionally left in the CHANGELOG.md, documentation and tests.
This commit is contained in:
parent
83545b8451
commit
6b21ad9922
199 changed files with 1256 additions and 1231 deletions
|
@ -39,7 +39,7 @@ func TestTypeConstantSize(t *testing.T) {
|
|||
src := `package foo
|
||||
import "github.com/nspcc-dev/neo-go/pkg/interop"
|
||||
var a %T // type declaration is always ok
|
||||
func Main() interface{} {
|
||||
func Main() any {
|
||||
return %#v
|
||||
}`
|
||||
|
||||
|
@ -532,7 +532,7 @@ func TestCallWithVersion(t *testing.T) {
|
|||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
util "github.com/nspcc-dev/neo-go/pkg/interop/lib/contract"
|
||||
)
|
||||
func CallWithVersion(hash interop.Hash160, version int, method string) interface{} {
|
||||
func CallWithVersion(hash interop.Hash160, version int, method string) any {
|
||||
return util.CallWithVersion(hash, version, method, contract.All)
|
||||
}`
|
||||
ctr := neotest.CompileSource(t, e.CommitteeHash, strings.NewReader(src), &compiler.Options{Name: "Helper"})
|
||||
|
@ -569,7 +569,7 @@ func TestForcedNotifyArgumentsConversion(t *testing.T) {
|
|||
runtime.Notify("withoutEllipsis", arg0, arg1, arg2, arg3, arg4, 5, f(6)) // The fifth argument is basic literal.
|
||||
}
|
||||
func WithEllipsis() {
|
||||
arg := []interface{}{0, 1, f(2), 3, 4, 5, 6}
|
||||
arg := []any{0, 1, f(2), 3, 4, 5, 6}
|
||||
runtime.Notify("withEllipsis", arg...)
|
||||
}
|
||||
func f(i int) int {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue