commit e6a3ceb5a6a2a010aea1c6c231d9780ea37fa77a from: Omar Polo date: Sat Nov 26 17:59:02 2022 UTC fmt commit - f3174901ce145f312d49dcc7ef402d539b9c7509 commit + e6a3ceb5a6a2a010aea1c6c231d9780ea37fa77a blob - ab3d70f9e4d10502e63782aea5586f5f7e6f5afe blob + cf6dbd1b964d53469705de3cadb9019eeb505eed --- encoding_test.go +++ encoding_test.go @@ -37,14 +37,16 @@ func TestEncodeDecode(t *testing.T) { 0x3, 0x0, // len(target) 0x4, 0x0, 0x61, 0x73, 0x64, 0x66, 0x4, 0x0, 0x71, 0x77, 0x65, 0x72, - 0x4, 0x0, 0x7a, 0x78, 0x63, 0x76}, + 0x4, 0x0, 0x7a, 0x78, 0x63, 0x76, + }, }, { description: "Qid", target: Qid{ Type: QTDIR, Version: 0x10203040, - Path: 0x1020304050607080}, + Path: 0x1020304050607080, + }, marshaled: []byte{ byte(QTDIR), // qtype 0x40, 0x30, 0x20, 0x10, // version @@ -64,7 +66,8 @@ func TestEncodeDecode(t *testing.T) { }, marshaled: []byte{ 0x64, 0xcf, 0x8, 0x0, 0x4, 0x0, 0x0, - 0x6, 0x0, 0x39, 0x50, 0x54, 0x45, 0x53, 0x54}, + 0x6, 0x0, 0x39, 0x50, 0x54, 0x45, 0x53, 0x54, + }, }, { description: "RversionFcall", @@ -78,7 +81,8 @@ func TestEncodeDecode(t *testing.T) { }, marshaled: []byte{ 0x65, 0xcf, 0x8, 0x0, 0x4, 0x0, 0x0, - 0x6, 0x0, 0x39, 0x50, 0x54, 0x45, 0x53, 0x54}, + 0x6, 0x0, 0x39, 0x50, 0x54, 0x45, 0x53, 0x54, + }, }, { description: "TwalkFcall", @@ -96,7 +100,8 @@ func TestEncodeDecode(t *testing.T) { 0x3, 0x0, // len(wnames) 0x1, 0x0, 0x61, // "a" 0x1, 0x0, 0x62, // "b" - 0x1, 0x0, 0x63}, // "c" + 0x1, 0x0, 0x63, // "c" + }, }, { description: "RwalkFcall", @@ -105,14 +110,16 @@ func TestEncodeDecode(t *testing.T) { Tag: 5556, Message: MessageRwalk{ Qids: []Qid{ - Qid{ + { Type: QTDIR, Path: 1111, Version: 11112, }, - Qid{Type: QTFILE, + { + Type: QTFILE, Version: 1112, - Path: 11114}, + Path: 11114, + }, }, }, }, @@ -120,7 +127,8 @@ func TestEncodeDecode(t *testing.T) { 0x6f, 0xb4, 0x15, 0x2, 0x0, 0x80, 0x68, 0x2b, 0x0, 0x0, 0x57, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x58, 0x4, 0x0, 0x0, 0x6a, 0x2b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + 0x0, 0x58, 0x4, 0x0, 0x0, 0x6a, 0x2b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + }, }, { description: "EmptyRreadFcall", @@ -131,7 +139,8 @@ func TestEncodeDecode(t *testing.T) { }, marshaled: []byte{ 0x75, 0xb4, 0x15, - 0x0, 0x0, 0x0, 0x0}, + 0x0, 0x0, 0x0, 0x0, + }, }, { description: "EmptyTwriteFcall", @@ -144,7 +153,8 @@ func TestEncodeDecode(t *testing.T) { byte(Twrite), 0xb4, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0}, + 0x0, 0x0, 0x0, 0x0, + }, }, { description: "RreadFcall", @@ -158,7 +168,8 @@ func TestEncodeDecode(t *testing.T) { marshaled: []byte{ 0x75, 0xb4, 0x15, 0x12, 0x0, 0x0, 0x0, - 0x61, 0x20, 0x6c, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61}, + 0x61, 0x20, 0x6c, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, + }, }, { description: "RstatFcall", @@ -200,7 +211,8 @@ func TestEncodeDecode(t *testing.T) { 0x7, 0x0, 0x73, 0x6f, 0x6d, 0x65, 0x64, 0x69, 0x72, 0x3, 0x0, 0x75, 0x69, 0x64, // uid 0x3, 0x0, 0x67, 0x69, 0x64, // gid - 0x4, 0x0, 0x6d, 0x75, 0x69, 0x64}, // muid + 0x4, 0x0, 0x6d, 0x75, 0x69, 0x64, // muid + }, }, { description: "DirSlice", @@ -359,7 +371,8 @@ func TestEncodeDecode(t *testing.T) { 0x6b, // Rerror 0xb4, 0x15, // Tag 0xf, 0x0, // String size. - 0x41, 0x20, 0x73, 0x65, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72}, + 0x41, 0x20, 0x73, 0x65, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, + }, }, } {