(unmarshal func(interface{}) error)
| 1307 | type obsoleteSliceUnmarshaler []int |
| 1308 | |
| 1309 | func (su *obsoleteSliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error { |
| 1310 | var slice []int |
| 1311 | err := unmarshal(&slice) |
| 1312 | if err == nil { |
| 1313 | *su = slice |
| 1314 | return nil |
| 1315 | } |
| 1316 | |
| 1317 | var intVal int |
| 1318 | err = unmarshal(&intVal) |
| 1319 | if err == nil { |
| 1320 | *su = []int{intVal} |
| 1321 | return nil |
| 1322 | } |
| 1323 | |
| 1324 | return err |
| 1325 | } |
| 1326 | |
| 1327 | func (s *S) TestObsoleteUnmarshalerRetry(c *C) { |
| 1328 | var su obsoleteSliceUnmarshaler |
nothing calls this directly
no test coverage detected