From 0e4fa96403ecc8c57638808342c8698d5cc0ecb0 Mon Sep 17 00:00:00 2001 From: Tom Arrell Date: Mon, 23 Sep 2024 14:28:20 +0200 Subject: [PATCH] feat: generated code identifier on first line (#455) --- cmd/avrogen/testdata/golden.go | 3 +-- cmd/avrogen/testdata/golden_encoders.go | 3 +-- cmd/avrogen/testdata/golden_encoders_fullschema.go | 3 +-- cmd/avrogen/testdata/golden_fullname.go | 3 +-- cmd/avrogen/testdata/golden_stricttypes.go | 3 +-- gen/output_template.tmpl | 5 ++--- gen/testdata/golden.go | 3 +-- gen/testdata/golden_encoders.go | 3 +-- gen/testdata/golden_encoders_fullschema.go | 3 +-- gen/testdata/golden_fullname.go | 3 +-- gen/testdata/golden_logicaltype.go | 3 +-- gen/testdata/golden_multiple.go | 3 +-- 12 files changed, 13 insertions(+), 25 deletions(-) diff --git a/cmd/avrogen/testdata/golden.go b/cmd/avrogen/testdata/golden.go index d6f5ca85..1f172713 100644 --- a/cmd/avrogen/testdata/golden.go +++ b/cmd/avrogen/testdata/golden.go @@ -1,8 +1,7 @@ +// Code generated by avro/gen. DO NOT EDIT. // package testpkg is generated from schema.avsc. package testpkg -// Code generated by avro/gen. DO NOT EDIT. - // Test is a test struct. type Test struct { // SomeString is a string. diff --git a/cmd/avrogen/testdata/golden_encoders.go b/cmd/avrogen/testdata/golden_encoders.go index 5f45e059..44b3e500 100644 --- a/cmd/avrogen/testdata/golden_encoders.go +++ b/cmd/avrogen/testdata/golden_encoders.go @@ -1,6 +1,5 @@ -package testpkg - // Code generated by avro/gen. DO NOT EDIT. +package testpkg import ( "github.com/hamba/avro/v2" diff --git a/cmd/avrogen/testdata/golden_encoders_fullschema.go b/cmd/avrogen/testdata/golden_encoders_fullschema.go index 721f0f71..7bc77367 100644 --- a/cmd/avrogen/testdata/golden_encoders_fullschema.go +++ b/cmd/avrogen/testdata/golden_encoders_fullschema.go @@ -1,6 +1,5 @@ -package testpkg - // Code generated by avro/gen. DO NOT EDIT. +package testpkg import ( "github.com/hamba/avro/v2" diff --git a/cmd/avrogen/testdata/golden_fullname.go b/cmd/avrogen/testdata/golden_fullname.go index fff85177..5b448013 100644 --- a/cmd/avrogen/testdata/golden_fullname.go +++ b/cmd/avrogen/testdata/golden_fullname.go @@ -1,6 +1,5 @@ -package testpkg - // Code generated by avro/gen. DO NOT EDIT. +package testpkg // Test is a test struct. type ABTest struct { diff --git a/cmd/avrogen/testdata/golden_stricttypes.go b/cmd/avrogen/testdata/golden_stricttypes.go index 9b2a0ae5..a3edc67d 100644 --- a/cmd/avrogen/testdata/golden_stricttypes.go +++ b/cmd/avrogen/testdata/golden_stricttypes.go @@ -1,6 +1,5 @@ -package testpkg - // Code generated by avro/gen. DO NOT EDIT. +package testpkg // Test is a test struct. type Test struct { diff --git a/gen/output_template.tmpl b/gen/output_template.tmpl index 1143fe52..9d6d59c0 100644 --- a/gen/output_template.tmpl +++ b/gen/output_template.tmpl @@ -1,10 +1,9 @@ +// Code generated by avro/gen. DO NOT EDIT. {{- if len .PackageDoc }} // {{ .PackageDoc }} {{- end }} package {{ .PackageName }} -// Code generated by avro/gen. DO NOT EDIT. - {{- $encoders := .WithEncoders }} {{ if len .Imports }} import ( @@ -57,4 +56,4 @@ package {{ .PackageName }} return avro.Marshal(o.Schema(), o) } {{- end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/gen/testdata/golden.go b/gen/testdata/golden.go index f0cbfbde..438b18af 100644 --- a/gen/testdata/golden.go +++ b/gen/testdata/golden.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something import ( "math/big" diff --git a/gen/testdata/golden_encoders.go b/gen/testdata/golden_encoders.go index 73d35186..2539c388 100644 --- a/gen/testdata/golden_encoders.go +++ b/gen/testdata/golden_encoders.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something import ( "math/big" diff --git a/gen/testdata/golden_encoders_fullschema.go b/gen/testdata/golden_encoders_fullschema.go index 908c13a9..fd012fa3 100644 --- a/gen/testdata/golden_encoders_fullschema.go +++ b/gen/testdata/golden_encoders_fullschema.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something import ( "math/big" diff --git a/gen/testdata/golden_fullname.go b/gen/testdata/golden_fullname.go index 4f398134..877c698e 100644 --- a/gen/testdata/golden_fullname.go +++ b/gen/testdata/golden_fullname.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something import ( "math/big" diff --git a/gen/testdata/golden_logicaltype.go b/gen/testdata/golden_logicaltype.go index c2f93c57..a32011f3 100644 --- a/gen/testdata/golden_logicaltype.go +++ b/gen/testdata/golden_logicaltype.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something import ( "math/big" diff --git a/gen/testdata/golden_multiple.go b/gen/testdata/golden_multiple.go index 34c3f082..6b074eed 100644 --- a/gen/testdata/golden_multiple.go +++ b/gen/testdata/golden_multiple.go @@ -1,6 +1,5 @@ -package something - // Code generated by avro/gen. DO NOT EDIT. +package something // TestUnionType is a generated struct. type TestUnionType struct {