You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

117 lines
1.6 KiB

  1. // Copyright 2017, The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE.md file.
  4. package testprotos
  5. func Equal(x, y Message) bool {
  6. if x == nil || y == nil {
  7. return x == nil && y == nil
  8. }
  9. return x.String() == y.String()
  10. }
  11. type Message interface {
  12. Proto()
  13. String() string
  14. }
  15. type proto interface {
  16. Proto()
  17. }
  18. type notComparable struct {
  19. unexportedField func()
  20. }
  21. type Stringer struct{ X string }
  22. func (s *Stringer) String() string { return s.X }
  23. // Project1 protocol buffers
  24. type (
  25. Eagle_States int
  26. Eagle_MissingCalls int
  27. Dreamer_States int
  28. Dreamer_MissingCalls int
  29. Slap_States int
  30. Goat_States int
  31. Donkey_States int
  32. SummerType int
  33. Eagle struct {
  34. proto
  35. notComparable
  36. Stringer
  37. }
  38. Dreamer struct {
  39. proto
  40. notComparable
  41. Stringer
  42. }
  43. Slap struct {
  44. proto
  45. notComparable
  46. Stringer
  47. }
  48. Goat struct {
  49. proto
  50. notComparable
  51. Stringer
  52. }
  53. Donkey struct {
  54. proto
  55. notComparable
  56. Stringer
  57. }
  58. )
  59. // Project2 protocol buffers
  60. type (
  61. Germ struct {
  62. proto
  63. notComparable
  64. Stringer
  65. }
  66. Dish struct {
  67. proto
  68. notComparable
  69. Stringer
  70. }
  71. )
  72. // Project3 protocol buffers
  73. type (
  74. Dirt struct {
  75. proto
  76. notComparable
  77. Stringer
  78. }
  79. Wizard struct {
  80. proto
  81. notComparable
  82. Stringer
  83. }
  84. Sadistic struct {
  85. proto
  86. notComparable
  87. Stringer
  88. }
  89. )
  90. // Project4 protocol buffers
  91. type (
  92. HoneyStatus int
  93. PoisonType int
  94. MetaData struct {
  95. proto
  96. notComparable
  97. Stringer
  98. }
  99. Restrictions struct {
  100. proto
  101. notComparable
  102. Stringer
  103. }
  104. )