You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./err.go:7:12: cannot use func literal (type func(int, *msg)) as type func(*msg, *msg) in argument to callback2
./err.go:17:11: cannot use cb (type func(*msg, *msg)) as type func(int, *msg) in argument to callback
System details
go version go1.9.2 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/Documents/dev/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hd/qg8xbds12bs0x4rqzgx6ggwc0000gn/T/go-build720067211=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOROOT/bin/go version: go version go1.9.2 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.9.2
uname -v: Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64
ProductName: Mac OS X
ProductVersion: 10.13.2
BuildVersion: 17C88
lldb --version: lldb-900.0.64
Swift-4.0
The text was updated successfully, but these errors were encountered:
The reason is because func(int, m *msg) is interpreted as func(int *msg, m *msg). That is, just like one can do func(a, b, c, d int) to receive four integers.
Perhaps the confusion here comes from the fact that int is simply a builtin type. You can call your variables and parameters int if you wish. With that in mind, the compiler can not help you with a better error message, because you have given it a valid program, syntactically speaking.
Please answer these questions before submitting your issue. Thanks!
What did you do?
error message is not accurate after writen error code:
What did you expect to see?
notify extra
m
What did you see instead?
System details
The text was updated successfully, but these errors were encountered: