(buf []byte, attr string)
| 139 | } |
| 140 | |
| 141 | func writeAttr(buf []byte, attr string) []byte { |
| 142 | AssertTrue(len(attr) < math.MaxUint16) |
| 143 | binary.BigEndian.PutUint16(buf[:2], uint16(len(attr))) |
| 144 | |
| 145 | rest := buf[2:] |
| 146 | AssertTrue(len(attr) == copy(rest, attr)) |
| 147 | |
| 148 | return rest[len(attr):] |
| 149 | } |
| 150 | |
| 151 | // genKey creates the key and writes the initial bytes (type byte, length of attribute, |
| 152 | // and the attribute itself). It leaves the rest of the key empty for further processing |
no test coverage detected
searching dependent graphs…