fix up typos for PR review

This commit is contained in:
Joe Williams 2022-10-15 11:43:24 -07:00
parent 4064a1fcd4
commit 4e8c622b47
2 changed files with 1 additions and 7 deletions

View File

@ -105,6 +105,7 @@ func (bigEndian) Uint64(b []byte) uint64 {
}
// For dealing with types not supported by the encoding/binary interface
func PutInt32(v int32) []byte {
buf := make([]byte, 4)
*(*int32)(unsafe.Pointer(&buf[0])) = v

View File

@ -130,13 +130,6 @@ func TestOtherTypes(t *testing.T) {
actual: PutString("test"),
unmarshal: func(b []byte) interface{} { return String(b) },
},
{
name: "NullTerminatedString",
expected: []byte{0x74, 0x65, 0x73, 0x74, 0x00},
expectedv: "test",
actual: PutNullTerminatedString("test"),
unmarshal: func(b []byte) interface{} { return String(b) },
},
}
for _, tt := range tests {
if bytes.Compare(tt.actual, tt.expected) != 0 {