main_test.go 674 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package yu_proto_old
  2. import (
  3. "fmt"
  4. yu_hex "gogs.qqck.cn/s/tools/hex"
  5. "testing"
  6. )
  7. type Arr struct {
  8. SSS struct {
  9. A []struct {
  10. A string
  11. B string
  12. C string
  13. D string
  14. } `protobuf:"5"`
  15. } `protobuf:"10"`
  16. }
  17. func TestProtobuf_Set(t *testing.T) {
  18. fmt.Println(yu_hex.Upper(Encode(&Arr{
  19. struct {
  20. A []struct {
  21. A string
  22. B string
  23. C string
  24. D string
  25. } `protobuf:"5"`
  26. }(struct {
  27. A []struct {
  28. A string
  29. B string
  30. C string
  31. D string
  32. }
  33. }{A: []struct {
  34. A string
  35. B string
  36. C string
  37. D string
  38. }{
  39. {"asd", "das", "123", "dasd"},
  40. {"123", "das", "123", "dasd"},
  41. {"321", "das", "123", "dasd"},
  42. }}),
  43. })))
  44. }