rodaine / protogofakeit Goto Github PK
View Code? Open in Web Editor NEWProduce fake data for protocol buffer messages
Home Page: https://pkg.go.dev/github.com/rodaine/protogofakeit
License: Apache License 2.0
Produce fake data for protocol buffer messages
Home Page: https://pkg.go.dev/github.com/rodaine/protogofakeit
License: Apache License 2.0
This causes a panic.
message User {
repeated Friend friends = 8;
}
message Friend {
oneof platform_details {
Human human = 1;
Animal animal = 2;
}
}
panic: type mismatch: cannot convert nil to message [recovered]
panic: type mismatch: cannot convert nil to message
goroutine 6 [running]:
testing.tRunner.func1.2({0x104a054a0, 0x140002850a0})
/Users/phumberdroz/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1631 +0x3c0
testing.tRunner.func1()
/Users/phumberdroz/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1634 +0x57c
panic({0x104a054a0?, 0x140002850a0?})
/Users/phumberdroz/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:770 +0xf0
google.golang.org/protobuf/reflect/protoreflect.Value.Message({{}, 0x0, 0x0, 0x0})
/Users/phumberdroz/go/pkg/mod/google.golang.org/[email protected]/reflect/protoreflect/value_union.go:346 +0x108
google.golang.org/protobuf/internal/impl.(*messageConverter).GoValueOf(0x140002844d0, {{}, 0x0, 0x0, 0x0})
/Users/phumberdroz/go/pkg/mod/google.golang.org/[email protected]/internal/impl/convert.go:439 +0x48
google.golang.org/protobuf/internal/impl.fieldInfoForOneof.func4({0x14000093dc0}, {{}, 0x0, 0x0, 0x0})
/Users/phumberdroz/go/pkg/mod/google.golang.org/[email protected]/internal/impl/message_reflect_field.go:122 +0x220
google.golang.org/protobuf/internal/impl.(*messageState).Set(0x14000093dc0, {0x104abf860, 0x140001e0600}, {{}, 0x0, 0x0, 0x0})
/Users/phumberdroz/go/pkg/mod/google.golang.org/[email protected]/internal/impl/message_reflect_gen.go:91 +0xec
github.com/rodaine/protogofakeit.(*protoFaker).fakeOneofs(0x1400023cb60, 0x1, {0x104abf028, 0x14000093dc0}, {0x104abf4c0, 0x140000c7760})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:161 +0x3e8
github.com/rodaine/protogofakeit.(*protoFaker).fake(0x1400023cb60, 0x1, {0x104abf028, 0x14000093dc0})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:142 +0x1d8
github.com/rodaine/protogofakeit.(*protoFaker).fakeFieldValue(0x1400023cb60, 0x0, {{}, 0x104a92e40, 0x14000093dc0, 0x0}, {0x104abf860, 0x140000be700}, 0x0, 0x1)
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:231 +0x484
github.com/rodaine/protogofakeit.(*protoFaker).fakeList(0x1400023cb60, 0x0, {0x104abf860, 0x140000be700}, 0x0, {0x104ab25d8, 0x14000269a70})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:307 +0x14c
github.com/rodaine/protogofakeit.(*protoFaker).fakeFieldValue(0x1400023cb60, 0x0, {{}, 0x104a77ac0, 0x14000269a70, 0x0}, {0x104abf860, 0x140000be700}, 0x0, 0x0)
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:220 +0x1f0
github.com/rodaine/protogofakeit.(*protoFaker).fakeField(0x1400023cb60, 0x0, {0x104abf028, 0x14000093540}, {0x104abf860, 0x140000be700})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:200 +0x14c
github.com/rodaine/protogofakeit.(*protoFaker).fakeFields(0x1400023cb60, 0x0, {0x104abf028, 0x14000093540}, {0x104abf4c0, 0x140000c7688})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:184 +0xe8
github.com/rodaine/protogofakeit.(*protoFaker).fake(0x1400023cb60, 0x0, {0x104abf028, 0x14000093540})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:145 +0x218
github.com/rodaine/protogofakeit.(*protoFaker).FakeProto(0x1400023cb60, {0x104aad8a8, 0x14000093540})
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/protogofakeit.go:135 +0x60
github.com/rodaine/protogofakeit_test.TestName(0x140001a1380)
/Users/phumberdroz/projects/spectrm/sandbox/protogofakeit/example_test.go:20 +0xbc
testing.tRunner(0x140001a1380, 0x104aa8b00)
/Users/phumberdroz/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1689 +0x1a8
created by testing.(*T).Run in goroutine 1
/Users/phumberdroz/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1742 +0x668
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.