1
0
mirror of https://github.com/fumiama/go-simple-protobuf.git synced 2026-06-08 12:00:26 +08:00

feat: add writer

This commit is contained in:
源文雨
2024-02-26 04:28:37 +09:00
parent 6c9102f75f
commit 83dfd6288b
6 changed files with 144 additions and 36 deletions

View File

@@ -65,3 +65,13 @@ func (it *Iterator) Bytes() []byte {
func (it *Iterator) String() string {
return string(it.v)
}
// Cap structlen 结构体带 padding 的长度
func (it *Iterator) Cap() uint32 {
return it.structlen
}
// Len reallen (迭代器目前迭代到的实值总长, 不带 padding)
func (it *Iterator) Len() uint32 {
return it.reallen
}