diff --git a/set/internal/gen/main.go b/set/internal/gen/main.go index ec20220..c568d89 100644 --- a/set/internal/gen/main.go +++ b/set/internal/gen/main.go @@ -99,6 +99,10 @@ func renderBytes(src []byte, typ genericType) []byte { func render(src string, typ genericType) string { const genericTypeName = "TypeName" + const doNotEditBanner = `/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ +` // Replace test constants src = strings.Replace(src, "One TypeName = 1", "One TypeName = "+typ.testVals[0], 1) src = strings.Replace(src, "Two TypeName = 2", "Two TypeName = "+typ.testVals[1], 1) @@ -107,7 +111,7 @@ func render(src string, typ genericType) string { src = strings.Replace(src, "Five TypeName = 5", "Five TypeName = "+typ.testVals[4], 1) // Replace the type name src = strings.Replace(src, genericTypeName, typ.name, -1) - return src + return doNotEditBanner + src } func gofmt(dir string) error { diff --git a/set/setint/set.go b/set/setint/set.go index 853ae9e..3cae6db 100755 --- a/set/setint/set.go +++ b/set/setint/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setint/set_test.go b/set/setint/set_test.go index 1b2a513..1101341 100755 --- a/set/setint/set_test.go +++ b/set/setint/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []int{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b int) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b int) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setint16/set.go b/set/setint16/set.go index 90d94aa..65d61c8 100755 --- a/set/setint16/set.go +++ b/set/setint16/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setint16/set_test.go b/set/setint16/set_test.go index 829be97..dd7bfb8 100755 --- a/set/setint16/set_test.go +++ b/set/setint16/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []int16{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b int16) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b int16) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setint32/set.go b/set/setint32/set.go index 636a163..71ba75e 100755 --- a/set/setint32/set.go +++ b/set/setint32/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setint32/set_test.go b/set/setint32/set_test.go index 47155eb..47326b1 100755 --- a/set/setint32/set_test.go +++ b/set/setint32/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []int32{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b int32) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b int32) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setint64/set.go b/set/setint64/set.go index 3fb8bbf..f931201 100755 --- a/set/setint64/set.go +++ b/set/setint64/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setint64/set_test.go b/set/setint64/set_test.go index 576ef80..f7875c9 100755 --- a/set/setint64/set_test.go +++ b/set/setint64/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []int64{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b int64) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b int64) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setint8/set.go b/set/setint8/set.go index 738b633..2f7c215 100755 --- a/set/setint8/set.go +++ b/set/setint8/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setint8/set_test.go b/set/setint8/set_test.go index def308d..e76af97 100755 --- a/set/setint8/set_test.go +++ b/set/setint8/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []int8{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b int8) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b int8) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setstring/set.go b/set/setstring/set.go index ca06297..eb43b90 100755 --- a/set/setstring/set.go +++ b/set/setstring/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setstring/set_test.go b/set/setstring/set_test.go index 59b8b10..ee93e67 100755 --- a/set/setstring/set_test.go +++ b/set/setstring/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []string{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b string) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b string) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setuint/set.go b/set/setuint/set.go index c9616e9..66cbca6 100755 --- a/set/setuint/set.go +++ b/set/setuint/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setuint/set_test.go b/set/setuint/set_test.go index ab36e5b..210cb69 100755 --- a/set/setuint/set_test.go +++ b/set/setuint/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []uint{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b uint) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b uint) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setuint16/set.go b/set/setuint16/set.go index fc5faeb..f89c4b9 100755 --- a/set/setuint16/set.go +++ b/set/setuint16/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setuint16/set_test.go b/set/setuint16/set_test.go index 21f82ec..30f874f 100755 --- a/set/setuint16/set_test.go +++ b/set/setuint16/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []uint16{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b uint16) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b uint16) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setuint32/set.go b/set/setuint32/set.go index f240f70..9ea6c1a 100755 --- a/set/setuint32/set.go +++ b/set/setuint32/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setuint32/set_test.go b/set/setuint32/set_test.go index 179ffe0..20be056 100755 --- a/set/setuint32/set_test.go +++ b/set/setuint32/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []uint32{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b uint32) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b uint32) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setuint64/set.go b/set/setuint64/set.go index a8a45f8..2bb46c4 100755 --- a/set/setuint64/set.go +++ b/set/setuint64/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setuint64/set_test.go b/set/setuint64/set_test.go index 5e0cf60..19f1e8c 100755 --- a/set/setuint64/set_test.go +++ b/set/setuint64/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []uint64{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b uint64) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b uint64) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) } diff --git a/set/setuint8/set.go b/set/setuint8/set.go index 4fcd10b..b4d7770 100755 --- a/set/setuint8/set.go +++ b/set/setuint8/set.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( diff --git a/set/setuint8/set_test.go b/set/setuint8/set_test.go index 1142eb9..856dbf5 100755 --- a/set/setuint8/set_test.go +++ b/set/setuint8/set_test.go @@ -1,3 +1,6 @@ +/******************************************************************************* +THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT! +*******************************************************************************/ package impl import ( @@ -98,9 +101,7 @@ func TestSlice(t *testing.T) { s := New(One, Two, Three) out := s.Slice() exp := []uint8{One, Two, Three} - ignoreOrder := cmpopts.SortSlices(func(a, b uint8) bool { - return a < b - }) + ignoreOrder := cmpopts.SortSlices(func(a, b uint8) bool { return a < b }) if !cmp.Equal(exp, out, ignoreOrder) { t.Errorf("Retured slice does not match: %s", cmp.Diff(exp, out)) }