Giter Site home page Giter Site logo

rodaine / protogofakeit Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 65 KB

Produce fake data for protocol buffer messages

Home Page: https://pkg.go.dev/github.com/rodaine/protogofakeit

License: Apache License 2.0

Makefile 5.69% Go 94.31%
golang proto protobuf protocol-buffers testing

protogofakeit's People

Contributors

dependabot[bot] avatar rodaine avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

protogofakeit's Issues

Panic: repeated oneOf causes Panic

This causes a panic.

message User {
  repeated Friend friends = 8;
}

message Friend {
  oneof platform_details {
    Human human = 1;
    Animal animal = 2;
  }
}
Stack trace Stack Trace:
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.