RS
а вот тут разница уже небольшая есть:
goos: darwin
goarch: amd64
pkg: gotest
BenchmarkSwitch-8 788176712 1.57 ns/op
BenchmarkOr-8 1000000000 0.896 ns/op
PASS
ok gotest 2.444s
Size: a a a
RS
goos: darwin
goarch: amd64
pkg: gotest
BenchmarkSwitch-8 788176712 1.57 ns/op
BenchmarkOr-8 1000000000 0.896 ns/op
PASS
ok gotest 2.444s
VM
Д
VM
NW
goos: darwin
goarch: amd64
pkg: gotest
BenchmarkSwitch-8 788176712 1.57 ns/op
BenchmarkOr-8 1000000000 0.896 ns/op
PASS
ok gotest 2.444s
RS
NW
W
Д
Д
switch n {
case 0:
return 0
case 1:
return 1
}
if n == 0 || n == 1 {
return n
}
RS
VM
DP
p
var foo *int
defer func(v *int) {
v = new(int)
*v = 5
}(foo)
DP
E
var foo *int
defer func(v *int) {
v = new(int)
*v = 5
}(foo)
D
D
AT
# github.com/Terisback/wrengo
In file included from _cgo_export.c:4:
cgo-gcc-export-header-prolog:46:14: error: conflicting types for 'wrengoBindForeignMethod'
In file included from _cgo_export.c:4:
wrengo.go:7:13: note: previous declaration of 'wrengoBindForeignMethod' was here
_cgo_export.c:43:7: error: conflicting types for 'wrengoBindForeignMethod'
void* wrengoBindForeignMethod(WrenVM* p0, char* p1, char* p2, _Bool p3, char* p4)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from _cgo_export.c:4:
wrengo.go:7:13: note: previous declaration of 'wrengoBindForeignMethod' was here