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
Hello,
When the "msg:size ignore Type" directive is used the tests still contain a reference to the Msgsize method, which does not exist.
For instance:
//msgp:size ignore Type package main type Type struct { A int } func main() { t := &Type{} _ = t }
generates the following test file:
package main // NOTE: THIS FILE WAS PRODUCED BY THE // MSGP CODE GENERATION TOOL (github.com/tinylib/msgp) // DO NOT EDIT import ( "bytes" "testing" "github.com/tinylib/msgp/msgp" ) func TestEncodeDecodeType(t *testing.T) { v := Type{} var buf bytes.Buffer msgp.Encode(&buf, &v) m := v.Msgsize() if buf.Len() > m { t.Logf("WARNING: Msgsize() for %v is inaccurate", v) } vn := Type{} err := msgp.Decode(&buf, &vn) if err != nil { t.Error(err) } buf.Reset() msgp.Encode(&buf, &v) err = msgp.NewReader(&buf).Skip() if err != nil { t.Error(err) } } func BenchmarkEncodeType(b *testing.B) { v := Type{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodeType(b *testing.B) { v := Type{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) rd := msgp.NewEndlessReader(buf.Bytes(), b) dc := msgp.NewReader(rd) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { err := v.DecodeMsg(dc) if err != nil { b.Fatal(err) } } }
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
When the "msg:size ignore Type" directive is used the tests still contain a reference to the Msgsize method, which does not exist.
For instance:
generates the following test file:
Thank you.
The text was updated successfully, but these errors were encountered: