We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code as following failed: var m interface{}=[]int{1,2} slType:=reflect2.TypeOf(m).(reflect2.SliceType) slType.LengthOf(m) //<--here i can't use &m
The text was updated successfully, but these errors were encountered:
+1
type message struct { crc uint16 } msg := &message{} unpack(b, msg) func unpack(b []byte, msg interface{}) error { buf := bytes.NewBuffer(b) typ := reflect2.TypeOf(msg) structType := typ.(*reflect2.UnsafeStructType) // panic ...
Sorry, something went wrong.
I fingure it out, it should be reflect2.TypeOfPtr(msg).Elem()
reflect2.TypeOfPtr(msg).Elem()
No branches or pull requests
code as following failed:
var m interface{}=[]int{1,2}
slType:=reflect2.TypeOf(m).(reflect2.SliceType)
slType.LengthOf(m) //<--here i can't use &m
The text was updated successfully, but these errors were encountered: