From 3b6853d209207ec8bc291d4412573fa84e7d2ca3 Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Sun, 9 Jul 2017 14:12:58 +0800 Subject: [PATCH] fix golint: do not export test types --- output_tests/array/struct_empty_alias/types.go | 4 ++-- output_tests/json_marshal/struct_alias/types.go | 8 ++++---- .../json_marshal/struct_field_alias/types.go | 8 ++++---- .../map/string/ptr_struct_various/types.go | 4 ++-- output_tests/map/string/string_alias/types.go | 4 ++-- .../map/string/struct_empty_alias/types.go | 4 ++-- output_tests/map/string_alias/string/types.go | 4 ++-- .../map/string_alias/string_alias/types.go | 4 ++-- .../map_key_text_marshal/string_alias/types.go | 14 +++++++------- .../map_key_text_marshal/struct/types.go | 12 ++++++------ output_tests/slice/struct_empty_alias/types.go | 4 ++-- output_tests/struct/alias/types.go | 4 ++-- .../anonymous/no_overlap/float64/types.go | 1 + .../struct/anonymous/no_overlap/int32/types.go | 1 + .../no_overlap/map_string_string/types.go | 1 + .../anonymous/no_overlap/ptr_float64/types.go | 1 + .../anonymous/no_overlap/ptr_int32/types.go | 1 + .../no_overlap/ptr_map_string_string/types.go | 1 + .../no_overlap/ptr_slice_string/types.go | 1 + .../anonymous/no_overlap/ptr_string/types.go | 1 + .../no_overlap/ptr_struct_various/types.go | 1 + .../anonymous/no_overlap/slice_string/types.go | 1 + .../struct/anonymous/no_overlap/string/types.go | 1 + .../no_overlap/string_with_tag/types.go | 1 + .../no_overlap/struct_various/types.go | 1 + .../anonymous/overlap/different_levels/types.go | 2 ++ .../overlap/ignore_deeper_level/types.go | 17 ++++++++++------- .../overlap/same_level_1_both_tagged/types.go | 10 ++++++---- .../overlap/same_level_1_no_tags/types.go | 10 ++++++---- .../overlap/same_level_1_tagged/types.go | 10 ++++++---- .../overlap/same_level_2_both_tagged/types.go | 12 ++++++++---- .../overlap/same_level_2_no_tags/types.go | 12 ++++++++---- .../overlap/same_level_2_tagged/types.go | 12 ++++++++---- output_tests/struct/array/string_alias/types.go | 8 ++++---- output_tests/struct/empty_alias/types.go | 4 ++-- output_tests/struct/float64_alias/types.go | 4 ++-- output_tests/struct/float64s_alias/types.go | 8 ++++---- output_tests/struct/int32_alias/types.go | 4 ++-- output_tests/struct/int32s_alias/types.go | 8 ++++---- output_tests/struct/ptr_float64_alias/types.go | 10 +++++----- output_tests/struct/ptr_int32_alias/types.go | 11 ++++++----- output_tests/struct/ptr_string_alias/types.go | 10 +++++----- output_tests/struct/slice/string_alias/types.go | 8 ++++---- output_tests/struct/string_alias/types.go | 4 ++-- output_tests/struct/strings_alias/types.go | 8 ++++---- output_tests/struct/struct/empty_alias/types.go | 4 ++-- .../struct/struct/float64_alias/types.go | 4 ++-- .../struct/struct/strings_alias/types.go | 12 ++++++------ .../struct_tags/fieldname/embedded/types.go | 11 +++++++++++ .../struct_tags/fieldname/string/types.go | 1 + .../struct_tags/fieldname/struct/types.go | 11 +++++++++++ .../struct_tags/omitempty/embedded/types.go | 1 + .../omitempty/ptr_string_json_marshal/types.go | 8 ++++---- .../omitempty/ptr_string_text_marshal/types.go | 8 ++++---- .../omitempty/ptr_struct_json_marshal/types.go | 8 ++++---- .../omitempty/ptr_struct_text_marshal/types.go | 8 ++++---- .../omitempty/string_text_marshal/types.go | 8 ++++---- .../omitempty/struct_json_marshal/types.go | 8 ++++---- .../omitempty/struct_text_marshal/types.go | 8 ++++---- output_tests/text_marshal/struct_alias/types.go | 4 ++-- .../text_marshal/struct_field_alias/types.go | 4 ++-- 61 files changed, 214 insertions(+), 153 deletions(-) diff --git a/output_tests/array/struct_empty_alias/types.go b/output_tests/array/struct_empty_alias/types.go index 4021b25..b72c8cf 100644 --- a/output_tests/array/struct_empty_alias/types.go +++ b/output_tests/array/struct_empty_alias/types.go @@ -1,5 +1,5 @@ package test -type A struct{} +type typeA struct{} -type typeForTest [4]A +type typeForTest [4]typeA diff --git a/output_tests/json_marshal/struct_alias/types.go b/output_tests/json_marshal/struct_alias/types.go index d1d860a..993b63f 100644 --- a/output_tests/json_marshal/struct_alias/types.go +++ b/output_tests/json_marshal/struct_alias/types.go @@ -46,9 +46,9 @@ func (m *marshalerForTest) UnmarshalJSON(text []byte) error { return nil } -var _ json.Marshaler = Marshaler{} -var _ json.Unmarshaler = &Marshaler{} +var _ json.Marshaler = marshalerForTest{} +var _ json.Unmarshaler = &marshalerForTest{} -type A Marshaler +type typeA marshalerForTest -type typeForTest A +type typeForTest typeA diff --git a/output_tests/json_marshal/struct_field_alias/types.go b/output_tests/json_marshal/struct_field_alias/types.go index 1636e86..7c0bf2b 100644 --- a/output_tests/json_marshal/struct_field_alias/types.go +++ b/output_tests/json_marshal/struct_field_alias/types.go @@ -46,13 +46,13 @@ func (m *marshalerForTest) UnmarshalJSON(text []byte) error { return nil } -var _ json.Marshaler = Marshaler{} -var _ json.Unmarshaler = &Marshaler{} +var _ json.Marshaler = marshalerForTest{} +var _ json.Unmarshaler = &marshalerForTest{} -type A Marshaler +type typeA marshalerForTest type typeForTest struct { S string - M A + M typeA I int8 } diff --git a/output_tests/map/string/ptr_struct_various/types.go b/output_tests/map/string/ptr_struct_various/types.go index 5190f86..0eca3cf 100644 --- a/output_tests/map/string/ptr_struct_various/types.go +++ b/output_tests/map/string/ptr_struct_various/types.go @@ -1,6 +1,6 @@ package test -type Struct struct { +type typeA struct { String string Int int32 Float float64 @@ -11,4 +11,4 @@ type Struct struct { Map map[string]string } -type typeForTest map[string]*Struct +type typeForTest map[string]*typeA diff --git a/output_tests/map/string/string_alias/types.go b/output_tests/map/string/string_alias/types.go index 48fd558..a5552fe 100644 --- a/output_tests/map/string/string_alias/types.go +++ b/output_tests/map/string/string_alias/types.go @@ -1,5 +1,5 @@ package test -type StringAlias string +type stringAlias string -type typeForTest map[string]StringAlias +type typeForTest map[string]stringAlias diff --git a/output_tests/map/string/struct_empty_alias/types.go b/output_tests/map/string/struct_empty_alias/types.go index 4f210c3..5491638 100644 --- a/output_tests/map/string/struct_empty_alias/types.go +++ b/output_tests/map/string/struct_empty_alias/types.go @@ -1,5 +1,5 @@ package test -type A struct{} +type typeA struct{} -type typeForTest map[string]A +type typeForTest map[string]typeA diff --git a/output_tests/map/string_alias/string/types.go b/output_tests/map/string_alias/string/types.go index d7e17c2..e10daa2 100644 --- a/output_tests/map/string_alias/string/types.go +++ b/output_tests/map/string_alias/string/types.go @@ -1,5 +1,5 @@ package test -type StringAlias string +type stringAlias string -type typeForTest map[StringAlias]string +type typeForTest map[stringAlias]string diff --git a/output_tests/map/string_alias/string_alias/types.go b/output_tests/map/string_alias/string_alias/types.go index 1d49f37..d50ce50 100644 --- a/output_tests/map/string_alias/string_alias/types.go +++ b/output_tests/map/string_alias/string_alias/types.go @@ -1,5 +1,5 @@ package test -type StringAlias string +type stringAlias string -type typeForTest map[StringAlias]StringAlias +type typeForTest map[stringAlias]stringAlias diff --git a/output_tests/map_key_text_marshal/string_alias/types.go b/output_tests/map_key_text_marshal/string_alias/types.go index 5fc41bf..f12da39 100644 --- a/output_tests/map_key_text_marshal/string_alias/types.go +++ b/output_tests/map_key_text_marshal/string_alias/types.go @@ -5,18 +5,18 @@ import ( "strings" ) -type KeyType string +type keyType string -func (k KeyType) MarshalText() ([]byte, error) { +func (k keyType) MarshalText() ([]byte, error) { return []byte("MANUAL__" + k), nil } -func (k *KeyType) UnmarshalText(text []byte) error { - *k = KeyType(strings.TrimPrefix(string(text), "MANUAL__")) +func (k *keyType) UnmarshalText(text []byte) error { + *k = keyType(strings.TrimPrefix(string(text), "MANUAL__")) return nil } -var _ encoding.TextMarshaler = KeyType("") -var _ encoding.TextUnmarshaler = new(KeyType) +var _ encoding.TextMarshaler = keyType("") +var _ encoding.TextUnmarshaler = new(keyType) -type typeForTest map[KeyType]string +type typeForTest map[keyType]string diff --git a/output_tests/map_key_text_marshal/struct/types.go b/output_tests/map_key_text_marshal/struct/types.go index 6283079..1944c1e 100644 --- a/output_tests/map_key_text_marshal/struct/types.go +++ b/output_tests/map_key_text_marshal/struct/types.go @@ -5,20 +5,20 @@ import ( "strings" ) -type KeyType struct { +type keyType struct { X string } -func (k KeyType) MarshalText() ([]byte, error) { +func (k keyType) MarshalText() ([]byte, error) { return []byte("MANUAL__" + k.X), nil } -func (k *KeyType) UnmarshalText(text []byte) error { +func (k *keyType) UnmarshalText(text []byte) error { k.X = strings.TrimPrefix(string(text), "MANUAL__") return nil } -var _ encoding.TextMarshaler = KeyType{} -var _ encoding.TextUnmarshaler = &KeyType{} +var _ encoding.TextMarshaler = keyType{} +var _ encoding.TextUnmarshaler = &keyType{} -type typeForTest map[KeyType]string +type typeForTest map[keyType]string diff --git a/output_tests/slice/struct_empty_alias/types.go b/output_tests/slice/struct_empty_alias/types.go index c6f7bdf..8d150ef 100644 --- a/output_tests/slice/struct_empty_alias/types.go +++ b/output_tests/slice/struct_empty_alias/types.go @@ -1,5 +1,5 @@ package test -type A struct{} +type typeA struct{} -type typeForTest []A +type typeForTest []typeA diff --git a/output_tests/struct/alias/types.go b/output_tests/struct/alias/types.go index 8dfc9de..947ada6 100644 --- a/output_tests/struct/alias/types.go +++ b/output_tests/struct/alias/types.go @@ -1,6 +1,6 @@ package test -type A struct { +type typeA struct { Byte1 byte Byte2 byte Bool1 bool @@ -17,4 +17,4 @@ type A struct { String2 string } -type typeForTest A +type typeForTest typeA diff --git a/output_tests/struct/anonymous/no_overlap/float64/types.go b/output_tests/struct/anonymous/no_overlap/float64/types.go index 39f7e20..1f45482 100644 --- a/output_tests/struct/anonymous/no_overlap/float64/types.go +++ b/output_tests/struct/anonymous/no_overlap/float64/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded float64 type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/int32/types.go b/output_tests/struct/anonymous/no_overlap/int32/types.go index ee026ed..a7275ed 100644 --- a/output_tests/struct/anonymous/no_overlap/int32/types.go +++ b/output_tests/struct/anonymous/no_overlap/int32/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded int32 type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/map_string_string/types.go b/output_tests/struct/anonymous/no_overlap/map_string_string/types.go index ea6b6fc..d56ee0a 100644 --- a/output_tests/struct/anonymous/no_overlap/map_string_string/types.go +++ b/output_tests/struct/anonymous/no_overlap/map_string_string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded map[string]string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_float64/types.go b/output_tests/struct/anonymous/no_overlap/ptr_float64/types.go index 8b46977..dbf0492 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_float64/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_float64/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded float64 type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_int32/types.go b/output_tests/struct/anonymous/no_overlap/ptr_int32/types.go index 19f84b0..24294e2 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_int32/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_int32/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded int32 type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_map_string_string/types.go b/output_tests/struct/anonymous/no_overlap/ptr_map_string_string/types.go index 57961f0..40dbec6 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_map_string_string/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_map_string_string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded map[string]string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_slice_string/types.go b/output_tests/struct/anonymous/no_overlap/ptr_slice_string/types.go index 7016bba..297b6af 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_slice_string/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_slice_string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded []string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_string/types.go b/output_tests/struct/anonymous/no_overlap/ptr_string/types.go index 80c6f51..06f4138 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_string/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/ptr_struct_various/types.go b/output_tests/struct/anonymous/no_overlap/ptr_struct_various/types.go index d4727e3..6a30819 100644 --- a/output_tests/struct/anonymous/no_overlap/ptr_struct_various/types.go +++ b/output_tests/struct/anonymous/no_overlap/ptr_struct_various/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded struct { String string Int int32 diff --git a/output_tests/struct/anonymous/no_overlap/slice_string/types.go b/output_tests/struct/anonymous/no_overlap/slice_string/types.go index fad975e..9c20be3 100644 --- a/output_tests/struct/anonymous/no_overlap/slice_string/types.go +++ b/output_tests/struct/anonymous/no_overlap/slice_string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded []string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/string/types.go b/output_tests/struct/anonymous/no_overlap/string/types.go index 6a7eac2..7b153fa 100644 --- a/output_tests/struct/anonymous/no_overlap/string/types.go +++ b/output_tests/struct/anonymous/no_overlap/string/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/string_with_tag/types.go b/output_tests/struct/anonymous/no_overlap/string_with_tag/types.go index 20a49f2..3e0919a 100644 --- a/output_tests/struct/anonymous/no_overlap/string_with_tag/types.go +++ b/output_tests/struct/anonymous/no_overlap/string_with_tag/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded string type typeForTest struct { diff --git a/output_tests/struct/anonymous/no_overlap/struct_various/types.go b/output_tests/struct/anonymous/no_overlap/struct_various/types.go index 9479322..d7eaeaa 100644 --- a/output_tests/struct/anonymous/no_overlap/struct_various/types.go +++ b/output_tests/struct/anonymous/no_overlap/struct_various/types.go @@ -1,5 +1,6 @@ package test +// Embedded TEST ONLY type Embedded struct { String string Int int32 diff --git a/output_tests/struct/anonymous/overlap/different_levels/types.go b/output_tests/struct/anonymous/overlap/different_levels/types.go index da60975..4c169ae 100644 --- a/output_tests/struct/anonymous/overlap/different_levels/types.go +++ b/output_tests/struct/anonymous/overlap/different_levels/types.go @@ -1,9 +1,11 @@ package test +// E1 TEST ONLY type E1 struct { F1 int32 } +// E2 TEST ONLY type E2 struct { F2 string } diff --git a/output_tests/struct/anonymous/overlap/ignore_deeper_level/types.go b/output_tests/struct/anonymous/overlap/ignore_deeper_level/types.go index 956ae9f..3da8950 100644 --- a/output_tests/struct/anonymous/overlap/ignore_deeper_level/types.go +++ b/output_tests/struct/anonymous/overlap/ignore_deeper_level/types.go @@ -1,20 +1,23 @@ package test -type doubleEmbedded struct { +// DoubleEmbedded TEST ONLY +type DoubleEmbedded struct { F1 int32 `json:"F1"` } -type embedded1 struct { - doubleEmbedded +// Embedded1 TEST ONLY +type Embedded1 struct { + DoubleEmbedded F1 int32 } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { F1 int32 `json:"F1"` - doubleEmbedded + DoubleEmbedded } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_1_both_tagged/types.go b/output_tests/struct/anonymous/overlap/same_level_1_both_tagged/types.go index a442d98..4ef30d6 100644 --- a/output_tests/struct/anonymous/overlap/same_level_1_both_tagged/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_1_both_tagged/types.go @@ -1,14 +1,16 @@ package test -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { F1 int32 `json:"F1"` } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { F1 int32 `json:"F1"` } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_1_no_tags/types.go b/output_tests/struct/anonymous/overlap/same_level_1_no_tags/types.go index 711af13..88f3596 100644 --- a/output_tests/struct/anonymous/overlap/same_level_1_no_tags/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_1_no_tags/types.go @@ -1,14 +1,16 @@ package test -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { F1 int32 } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { F1 int32 } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_1_tagged/types.go b/output_tests/struct/anonymous/overlap/same_level_1_tagged/types.go index 7863f11..180b9b7 100644 --- a/output_tests/struct/anonymous/overlap/same_level_1_tagged/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_1_tagged/types.go @@ -1,14 +1,16 @@ package test -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { F1 int32 } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { F1 int32 `json:"F1"` } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_2_both_tagged/types.go b/output_tests/struct/anonymous/overlap/same_level_2_both_tagged/types.go index 94c2fae..3265085 100644 --- a/output_tests/struct/anonymous/overlap/same_level_2_both_tagged/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_2_both_tagged/types.go @@ -1,22 +1,26 @@ package test +// DoubleEmbedded1 TEST ONLY type DoubleEmbedded1 struct { F1 int32 `json:"F1"` } -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { DoubleEmbedded1 } +// DoubleEmbedded2 TEST ONLY type DoubleEmbedded2 struct { F1 int32 `json:"F1"` } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { DoubleEmbedded2 } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_2_no_tags/types.go b/output_tests/struct/anonymous/overlap/same_level_2_no_tags/types.go index e504ffa..5b20d89 100644 --- a/output_tests/struct/anonymous/overlap/same_level_2_no_tags/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_2_no_tags/types.go @@ -1,22 +1,26 @@ package test +// DoubleEmbedded1 TEST ONLY type DoubleEmbedded1 struct { F1 int32 } -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { DoubleEmbedded1 } +// DoubleEmbedded2 TEST ONLY type DoubleEmbedded2 struct { F1 int32 } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { DoubleEmbedded2 } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/anonymous/overlap/same_level_2_tagged/types.go b/output_tests/struct/anonymous/overlap/same_level_2_tagged/types.go index 673b2bc..97f9e23 100644 --- a/output_tests/struct/anonymous/overlap/same_level_2_tagged/types.go +++ b/output_tests/struct/anonymous/overlap/same_level_2_tagged/types.go @@ -1,22 +1,26 @@ package test +// DoubleEmbedded1 TEST ONLY type DoubleEmbedded1 struct { F1 int32 } -type embedded1 struct { +// Embedded1 TEST ONLY +type Embedded1 struct { DoubleEmbedded1 } +// DoubleEmbedded2 TEST ONLY type DoubleEmbedded2 struct { F1 int32 `json:"F1"` } -type embedded2 struct { +// Embedded2 TEST ONLY +type Embedded2 struct { DoubleEmbedded2 } type typeForTest struct { - embedded1 - embedded2 + Embedded1 + Embedded2 } diff --git a/output_tests/struct/array/string_alias/types.go b/output_tests/struct/array/string_alias/types.go index 9e1e303..1d4ce49 100644 --- a/output_tests/struct/array/string_alias/types.go +++ b/output_tests/struct/array/string_alias/types.go @@ -1,9 +1,9 @@ package test -type A1 string -type A2 [4]A1 +type typeA1 string +type typeA2 [4]typeA1 type typeForTest struct { - F1 [4]A1 - F2 A2 + F1 [4]typeA1 + F2 typeA2 } diff --git a/output_tests/struct/empty_alias/types.go b/output_tests/struct/empty_alias/types.go index 97c5ea3..c50475a 100644 --- a/output_tests/struct/empty_alias/types.go +++ b/output_tests/struct/empty_alias/types.go @@ -1,5 +1,5 @@ package test -type A struct{} +type typeA struct{} -type typeForTest A +type typeForTest typeA diff --git a/output_tests/struct/float64_alias/types.go b/output_tests/struct/float64_alias/types.go index ffbe7e2..88a8ad1 100644 --- a/output_tests/struct/float64_alias/types.go +++ b/output_tests/struct/float64_alias/types.go @@ -1,7 +1,7 @@ package test -type A float64 +type typeA float64 type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct/float64s_alias/types.go b/output_tests/struct/float64s_alias/types.go index 4b760ca..dfb4b56 100644 --- a/output_tests/struct/float64s_alias/types.go +++ b/output_tests/struct/float64s_alias/types.go @@ -1,9 +1,9 @@ package test -type A float64 +type typeA float64 type typeForTest struct { - F1 A - F2 A - F3 A + F1 typeA + F2 typeA + F3 typeA } diff --git a/output_tests/struct/int32_alias/types.go b/output_tests/struct/int32_alias/types.go index 642d341..fcafa26 100644 --- a/output_tests/struct/int32_alias/types.go +++ b/output_tests/struct/int32_alias/types.go @@ -1,7 +1,7 @@ package test -type A int32 +type typeA int32 type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct/int32s_alias/types.go b/output_tests/struct/int32s_alias/types.go index 19c89f3..d168647 100644 --- a/output_tests/struct/int32s_alias/types.go +++ b/output_tests/struct/int32s_alias/types.go @@ -1,9 +1,9 @@ package test -type A int32 +type typeA int32 type typeForTest struct { - F1 A - F2 A - F3 A + F1 typeA + F2 typeA + F3 typeA } diff --git a/output_tests/struct/ptr_float64_alias/types.go b/output_tests/struct/ptr_float64_alias/types.go index 85f1cb1..fdcc1df 100644 --- a/output_tests/struct/ptr_float64_alias/types.go +++ b/output_tests/struct/ptr_float64_alias/types.go @@ -1,10 +1,10 @@ package test -type A1 float64 -type A2 *float64 +type typeA1 float64 +type typeA2 *float64 type typeForTest struct { - F1 *A1 - F2 A2 - F3 *A2 + F1 *typeA1 + F2 typeA2 + F3 *typeA2 } diff --git a/output_tests/struct/ptr_int32_alias/types.go b/output_tests/struct/ptr_int32_alias/types.go index 3f2ba3e..96b1fff 100644 --- a/output_tests/struct/ptr_int32_alias/types.go +++ b/output_tests/struct/ptr_int32_alias/types.go @@ -1,10 +1,11 @@ package test -type A1 int32 -type A2 *int32 +type typeA1 int32 + +type typeA2 *int32 type typeForTest struct { - F1 *A1 - F2 A2 - F3 *A2 + F1 *typeA1 + F2 typeA2 + F3 *typeA2 } diff --git a/output_tests/struct/ptr_string_alias/types.go b/output_tests/struct/ptr_string_alias/types.go index f4e17d6..cc19b97 100644 --- a/output_tests/struct/ptr_string_alias/types.go +++ b/output_tests/struct/ptr_string_alias/types.go @@ -1,10 +1,10 @@ package test -type A1 string -type A2 *string +type typeA1 string +type typeA2 *string type typeForTest struct { - F1 *A1 - F2 A2 - F3 *A2 + F1 *typeA1 + F2 typeA2 + F3 *typeA2 } diff --git a/output_tests/struct/slice/string_alias/types.go b/output_tests/struct/slice/string_alias/types.go index 298f091..3a95f53 100644 --- a/output_tests/struct/slice/string_alias/types.go +++ b/output_tests/struct/slice/string_alias/types.go @@ -1,9 +1,9 @@ package test -type A1 string -type A2 []A1 +type typeA1 string +type typeA2 []typeA1 type typeForTest struct { - F1 []A1 - F2 A2 + F1 []typeA1 + F2 typeA2 } diff --git a/output_tests/struct/string_alias/types.go b/output_tests/struct/string_alias/types.go index 9add8b2..e4e785a 100644 --- a/output_tests/struct/string_alias/types.go +++ b/output_tests/struct/string_alias/types.go @@ -1,7 +1,7 @@ package test -type A string +type typeA string type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct/strings_alias/types.go b/output_tests/struct/strings_alias/types.go index fd5bbec..e339766 100644 --- a/output_tests/struct/strings_alias/types.go +++ b/output_tests/struct/strings_alias/types.go @@ -1,9 +1,9 @@ package test -type A string +type typeA string type typeForTest struct { - F1 A - F2 A - F3 A + F1 typeA + F2 typeA + F3 typeA } diff --git a/output_tests/struct/struct/empty_alias/types.go b/output_tests/struct/struct/empty_alias/types.go index c5d0fc5..ee8002e 100644 --- a/output_tests/struct/struct/empty_alias/types.go +++ b/output_tests/struct/struct/empty_alias/types.go @@ -1,7 +1,7 @@ package test -type A struct{} +type typeA struct{} type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct/struct/float64_alias/types.go b/output_tests/struct/struct/float64_alias/types.go index 6562a5c..8c38424 100644 --- a/output_tests/struct/struct/float64_alias/types.go +++ b/output_tests/struct/struct/float64_alias/types.go @@ -1,9 +1,9 @@ package test -type A struct { +type typeA struct { F float64 } type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct/struct/strings_alias/types.go b/output_tests/struct/struct/strings_alias/types.go index c625e7f..6468df3 100644 --- a/output_tests/struct/struct/strings_alias/types.go +++ b/output_tests/struct/struct/strings_alias/types.go @@ -1,13 +1,13 @@ package test -type S string +type typeS string -type A struct { - F1 S - F2 S - F3 S +type typeA struct { + F1 typeS + F2 typeS + F3 typeS } type typeForTest struct { - F A + F typeA } diff --git a/output_tests/struct_tags/fieldname/embedded/types.go b/output_tests/struct_tags/fieldname/embedded/types.go index afcb556..ec596be 100644 --- a/output_tests/struct_tags/fieldname/embedded/types.go +++ b/output_tests/struct_tags/fieldname/embedded/types.go @@ -1,20 +1,31 @@ package test +// S1 TEST ONLY type S1 struct { S1F string } + +// S2 TEST ONLY type S2 struct { S2F string } + +// S3 TEST ONLY type S3 struct { S3F string } + +// S4 TEST ONLY type S4 struct { S4F string } + +// S5 TEST ONLY type S5 struct { S5F string } + +// S6 TEST ONLY type S6 struct { S6F string } diff --git a/output_tests/struct_tags/fieldname/string/types.go b/output_tests/struct_tags/fieldname/string/types.go index ce565c1..b279bac 100644 --- a/output_tests/struct_tags/fieldname/string/types.go +++ b/output_tests/struct_tags/fieldname/string/types.go @@ -1,5 +1,6 @@ package test +// E TEST ONLY type E struct { E1 string } diff --git a/output_tests/struct_tags/fieldname/struct/types.go b/output_tests/struct_tags/fieldname/struct/types.go index 01db4aa..fb7d3e5 100644 --- a/output_tests/struct_tags/fieldname/struct/types.go +++ b/output_tests/struct_tags/fieldname/struct/types.go @@ -1,20 +1,31 @@ package test +// S1 TEST ONLY type S1 struct { S1F string } + +// S2 TEST ONLY type S2 struct { S2F string } + +// S3 TEST ONLY type S3 struct { S3F string } + +// S4 TEST ONLY type S4 struct { S4F string } + +// S5 TEST ONLY type S5 struct { S5F string } + +// S6 TEST ONLY type S6 struct { S6F string } diff --git a/output_tests/struct_tags/omitempty/embedded/types.go b/output_tests/struct_tags/omitempty/embedded/types.go index c1da334..e53a6ad 100644 --- a/output_tests/struct_tags/omitempty/embedded/types.go +++ b/output_tests/struct_tags/omitempty/embedded/types.go @@ -1,5 +1,6 @@ package test +// E TEST ONLY type E struct { F string `json:"F,omitempty"` } diff --git a/output_tests/struct_tags/omitempty/ptr_string_json_marshal/types.go b/output_tests/struct_tags/omitempty/ptr_string_json_marshal/types.go index 5c3d7b6..25077cb 100644 --- a/output_tests/struct_tags/omitempty/ptr_string_json_marshal/types.go +++ b/output_tests/struct_tags/omitempty/ptr_string_json_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F *JM `json:"f,omitempty"` + F *jm `json:"f,omitempty"` } -type JM string +type jm string -func (t *JM) UnmarshalJSON(b []byte) error { +func (t *jm) UnmarshalJSON(b []byte) error { return nil } -func (t JM) MarshalJSON() ([]byte, error) { +func (t jm) MarshalJSON() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/ptr_string_text_marshal/types.go b/output_tests/struct_tags/omitempty/ptr_string_text_marshal/types.go index 7d01a83..f604c10 100644 --- a/output_tests/struct_tags/omitempty/ptr_string_text_marshal/types.go +++ b/output_tests/struct_tags/omitempty/ptr_string_text_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F *TM `json:"f,omitempty"` + F *tm `json:"f,omitempty"` } -type TM string +type tm string -func (t *TM) UnmarshalText(b []byte) error { +func (t *tm) UnmarshalText(b []byte) error { return nil } -func (t TM) MarshalText() ([]byte, error) { +func (t tm) MarshalText() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/ptr_struct_json_marshal/types.go b/output_tests/struct_tags/omitempty/ptr_struct_json_marshal/types.go index 09d4839..f172778 100644 --- a/output_tests/struct_tags/omitempty/ptr_struct_json_marshal/types.go +++ b/output_tests/struct_tags/omitempty/ptr_struct_json_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F *JM `json:"f,omitempty"` + F *jm `json:"f,omitempty"` } -type JM struct{} +type jm struct{} -func (t *JM) UnmarshalJSON(b []byte) error { +func (t *jm) UnmarshalJSON(b []byte) error { return nil } -func (t JM) MarshalJSON() ([]byte, error) { +func (t jm) MarshalJSON() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/ptr_struct_text_marshal/types.go b/output_tests/struct_tags/omitempty/ptr_struct_text_marshal/types.go index 9044989..c89a3b8 100644 --- a/output_tests/struct_tags/omitempty/ptr_struct_text_marshal/types.go +++ b/output_tests/struct_tags/omitempty/ptr_struct_text_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F *TM `json:"f,omitempty"` + F *tm `json:"f,omitempty"` } -type TM struct{} +type tm struct{} -func (t *TM) UnmarshalText(b []byte) error { +func (t *tm) UnmarshalText(b []byte) error { return nil } -func (t TM) MarshalText() ([]byte, error) { +func (t tm) MarshalText() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/string_text_marshal/types.go b/output_tests/struct_tags/omitempty/string_text_marshal/types.go index 423505b..4eb9612 100644 --- a/output_tests/struct_tags/omitempty/string_text_marshal/types.go +++ b/output_tests/struct_tags/omitempty/string_text_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F TM `json:"f,omitempty"` + F tm `json:"f,omitempty"` } -type TM string +type tm string -func (t *TM) UnmarshalText(b []byte) error { +func (t *tm) UnmarshalText(b []byte) error { return nil } -func (t TM) MarshalText() ([]byte, error) { +func (t tm) MarshalText() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/struct_json_marshal/types.go b/output_tests/struct_tags/omitempty/struct_json_marshal/types.go index 02d3d71..f6fb437 100644 --- a/output_tests/struct_tags/omitempty/struct_json_marshal/types.go +++ b/output_tests/struct_tags/omitempty/struct_json_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F JM `json:"f,omitempty"` + F jm `json:"f,omitempty"` } -type JM struct{} +type jm struct{} -func (t *JM) UnmarshalJSON(b []byte) error { +func (t *jm) UnmarshalJSON(b []byte) error { return nil } -func (t JM) MarshalJSON() ([]byte, error) { +func (t jm) MarshalJSON() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/struct_tags/omitempty/struct_text_marshal/types.go b/output_tests/struct_tags/omitempty/struct_text_marshal/types.go index 9d0c850..112f14e 100644 --- a/output_tests/struct_tags/omitempty/struct_text_marshal/types.go +++ b/output_tests/struct_tags/omitempty/struct_text_marshal/types.go @@ -1,15 +1,15 @@ package test type typeForTest struct { - F TM `json:"f,omitempty"` + F tm `json:"f,omitempty"` } -type TM struct{} +type tm struct{} -func (t *TM) UnmarshalText(b []byte) error { +func (t *tm) UnmarshalText(b []byte) error { return nil } -func (t TM) MarshalText() ([]byte, error) { +func (t tm) MarshalText() ([]byte, error) { return []byte(`""`), nil } diff --git a/output_tests/text_marshal/struct_alias/types.go b/output_tests/text_marshal/struct_alias/types.go index 7458276..9cf6030 100644 --- a/output_tests/text_marshal/struct_alias/types.go +++ b/output_tests/text_marshal/struct_alias/types.go @@ -49,6 +49,6 @@ func (m *marshalerForTest) UnmarshalText(text []byte) error { var _ encoding.TextMarshaler = marshalerForTest{} var _ encoding.TextUnmarshaler = &marshalerForTest{} -type A marshalerForTest +type marshalerAlias marshalerForTest -type typeForTest A +type typeForTest marshalerAlias diff --git a/output_tests/text_marshal/struct_field_alias/types.go b/output_tests/text_marshal/struct_field_alias/types.go index 0e2e02e..fbfb758 100644 --- a/output_tests/text_marshal/struct_field_alias/types.go +++ b/output_tests/text_marshal/struct_field_alias/types.go @@ -49,10 +49,10 @@ func (m *marshalerForTest) UnmarshalText(text []byte) error { var _ encoding.TextMarshaler = marshalerForTest{} var _ encoding.TextUnmarshaler = &marshalerForTest{} -type A marshalerForTest +type marshalerAlias marshalerForTest type typeForTest struct { S string - M A + M marshalerAlias I int8 }