diff --git a/net/packet/packet.go b/net/packet/packet.go index 1a3f7e5..29cda36 100644 --- a/net/packet/packet.go +++ b/net/packet/packet.go @@ -173,7 +173,7 @@ func (p *Packet) unpackWithoutCompression(r io.Reader) error { lengthOfData := int(Length) - int(n) if lengthOfData < 0 || lengthOfData > MaxDataLength { - return fmt.Errorf("uncompressed packet error: lenght is %d", lengthOfData) + return fmt.Errorf("uncompressed packet error: length is %d", lengthOfData) } if cap(p.Data) < lengthOfData { p.Data = make([]byte, lengthOfData) diff --git a/net/packet/packet_test.go b/net/packet/packet_test.go index fc50f61..9c1559b 100644 --- a/net/packet/packet_test.go +++ b/net/packet/packet_test.go @@ -111,7 +111,7 @@ func ExamplePacket_Scan_joinGame() { Hardcore pk.Boolean Gamemode pk.UnsignedByte PreGamemode pk.Byte - WorldNames = make([]pk.Identifier, 0) // This cannot replace with "var DimensionNames []pk.Identifier" because "nil" has no type information + WorldNames = []pk.Identifier{} // This cannot replace with "var DimensionNames []pk.Identifier" because "nil" has no type information DimensionCodec struct { DimensionType interface{} `nbt:"minecraft:dimension_type"` WorldgenBiome interface{} `nbt:"minecraft:worldgen/biome"`