@@ -16,15 +16,15 @@ type testInterface interface {
16
16
String () string
17
17
}
18
18
19
- type substruct_noValidation struct {
20
- I_String string
21
- I_Int int
19
+ type substructNoValidation struct {
20
+ IString string
21
+ IInt int
22
22
}
23
23
24
- type mapNoValidationSub map [string ]substruct_noValidation
24
+ type mapNoValidationSub map [string ]substructNoValidation
25
25
26
- type struct_noValidation_values struct {
27
- substruct_noValidation
26
+ type structNoValidationValues struct {
27
+ substructNoValidation
28
28
29
29
Boolean bool
30
30
@@ -46,16 +46,16 @@ type struct_noValidation_values struct {
46
46
47
47
Date time.Time
48
48
49
- Struct substruct_noValidation
49
+ Struct substructNoValidation
50
50
InlinedStruct struct {
51
51
String []string
52
52
Integer int
53
53
}
54
54
55
55
IntSlice []int
56
56
IntPointerSlice []* int
57
- StructPointerSlice []* substruct_noValidation
58
- StructSlice []substruct_noValidation
57
+ StructPointerSlice []* substructNoValidation
58
+ StructSlice []substructNoValidation
59
59
InterfaceSlice []testInterface
60
60
61
61
UniversalInterface interface {}
@@ -65,9 +65,9 @@ type struct_noValidation_values struct {
65
65
StructMap mapNoValidationSub
66
66
}
67
67
68
- func createNoValidation_values () struct_noValidation_values {
68
+ func createNoValidationValues () structNoValidationValues {
69
69
integer := 1
70
- s := struct_noValidation_values {
70
+ s := structNoValidationValues {
71
71
Boolean : true ,
72
72
Uinteger : 1 << 29 ,
73
73
Integer : - 10000 ,
@@ -84,33 +84,33 @@ func createNoValidation_values() struct_noValidation_values {
84
84
String : "text" ,
85
85
Date : time.Time {},
86
86
CustomInterface : & bytes.Buffer {},
87
- Struct : substruct_noValidation {},
87
+ Struct : substructNoValidation {},
88
88
IntSlice : []int {- 3 , - 2 , 1 , 0 , 1 , 2 , 3 },
89
89
IntPointerSlice : []* int {& integer },
90
- StructSlice : []substruct_noValidation {},
90
+ StructSlice : []substructNoValidation {},
91
91
UniversalInterface : 1.2 ,
92
92
FloatMap : map [string ]float32 {
93
93
"foo" : 1.23 ,
94
94
"bar" : 232.323 ,
95
95
},
96
96
StructMap : mapNoValidationSub {
97
- "foo" : substruct_noValidation {},
98
- "bar" : substruct_noValidation {},
97
+ "foo" : substructNoValidation {},
98
+ "bar" : substructNoValidation {},
99
99
},
100
100
// StructPointerSlice []noValidationSub
101
101
// InterfaceSlice []testInterface
102
102
}
103
103
s .InlinedStruct .Integer = 1000
104
104
s .InlinedStruct .String = []string {"first" , "second" }
105
- s .I_String = "substring"
106
- s .I_Int = 987654
105
+ s .IString = "substring"
106
+ s .IInt = 987654
107
107
return s
108
108
}
109
109
110
110
func TestValidateNoValidationValues (t * testing.T ) {
111
- origin := createNoValidation_values ()
112
- test := createNoValidation_values ()
113
- empty := struct_noValidation_values {}
111
+ origin := createNoValidationValues ()
112
+ test := createNoValidationValues ()
113
+ empty := structNoValidationValues {}
114
114
115
115
assert .Nil (t , validate (test ))
116
116
assert .Nil (t , validate (& test ))
@@ -120,8 +120,8 @@ func TestValidateNoValidationValues(t *testing.T) {
120
120
assert .Equal (t , origin , test )
121
121
}
122
122
123
- type struct_noValidation_pointer struct {
124
- substruct_noValidation
123
+ type structNoValidationPointer struct {
124
+ substructNoValidation
125
125
126
126
Boolean bool
127
127
@@ -143,12 +143,12 @@ type struct_noValidation_pointer struct {
143
143
144
144
Date * time.Time
145
145
146
- Struct * substruct_noValidation
146
+ Struct * substructNoValidation
147
147
148
148
IntSlice * []int
149
149
IntPointerSlice * []* int
150
- StructPointerSlice * []* substruct_noValidation
151
- StructSlice * []substruct_noValidation
150
+ StructPointerSlice * []* substructNoValidation
151
+ StructSlice * []substructNoValidation
152
152
InterfaceSlice * []testInterface
153
153
154
154
FloatMap * map [string ]float32
@@ -158,7 +158,7 @@ type struct_noValidation_pointer struct {
158
158
func TestValidateNoValidationPointers (t * testing.T ) {
159
159
//origin := createNoValidation_values()
160
160
//test := createNoValidation_values()
161
- empty := struct_noValidation_pointer {}
161
+ empty := structNoValidationPointer {}
162
162
163
163
//assert.Nil(t, validate(test))
164
164
//assert.Nil(t, validate(&test))
0 commit comments