Skip to content

Commit 6efe6b7

Browse files
committed
fix: combine appends to satisfy gocritic lint
1 parent 50c4d32 commit 6efe6b7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

pkg/schema/schema_type_fuzz_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ const maxFuzzDepth = 8
8585

8686
// encodeAnnotation serializes a TypeAnnotation to bytes.
8787
func encodeAnnotation(ann TypeAnnotation) []byte {
88-
var buf []byte
89-
buf = append(buf, byte(ann.Kind))
90-
buf = append(buf, byte(len(ann.Name)))
91-
buf = append(buf, []byte(ann.Name)...)
88+
buf := append([]byte{byte(ann.Kind), byte(len(ann.Name))}, []byte(ann.Name)...)
9289
buf = append(buf, byte(len(ann.Args)))
9390
for _, a := range ann.Args {
9491
buf = append(buf, encodeAnnotation(a)...)

0 commit comments

Comments
 (0)