main.go 269 B

12345678910111213141516171819202122232425
  1. package yu_proto
  2. type Protobuf struct {
  3. list *node
  4. tmp_buf []byte
  5. }
  6. type node struct {
  7. _next *node
  8. id uint64
  9. value any
  10. }
  11. func New() (t *Protobuf) {
  12. t = &Protobuf{}
  13. t.Reset()
  14. return
  15. }
  16. func (t *Protobuf) Reset() *Protobuf {
  17. t.list = &node{}
  18. return t
  19. }