(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestComposeDecodeHookFunc_safe_nofuncs(t *testing.T) { |
| 176 | f := ComposeDecodeHookFunc() |
| 177 | type myStruct2 struct { |
| 178 | MyInt int |
| 179 | } |
| 180 | |
| 181 | type myStruct1 struct { |
| 182 | Blah map[string]myStruct2 |
| 183 | } |
| 184 | |
| 185 | src := &myStruct1{Blah: map[string]myStruct2{ |
| 186 | "test": { |
| 187 | MyInt: 1, |
| 188 | }, |
| 189 | }} |
| 190 | |
| 191 | dst := &myStruct1{} |
| 192 | dConf := &DecoderConfig{ |
| 193 | Result: dst, |
| 194 | ErrorUnused: true, |
| 195 | DecodeHook: f, |
| 196 | } |
| 197 | d, err := NewDecoder(dConf) |
| 198 | if err != nil { |
| 199 | t.Fatal(err) |
| 200 | } |
| 201 | err = d.Decode(src) |
| 202 | if err != nil { |
| 203 | t.Fatal(err) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | func TestStringToSliceHookFunc(t *testing.T) { |
| 208 | f := StringToSliceHookFunc(",") |
nothing calls this directly
no test coverage detected
searching dependent graphs…