(v interface{}, fnames []string)
| 11 | ) |
| 12 | |
| 13 | func assertCallbacks(v interface{}, fnames []string) (result bool, msg string) { |
| 14 | var ( |
| 15 | got []string |
| 16 | funcs = reflect.ValueOf(v).Elem().FieldByName("fns") |
| 17 | ) |
| 18 | |
| 19 | for i := 0; i < funcs.Len(); i++ { |
| 20 | got = append(got, getFuncName(funcs.Index(i))) |
| 21 | } |
| 22 | |
| 23 | return fmt.Sprint(got) == fmt.Sprint(fnames), fmt.Sprintf("expects %v, got %v", fnames, got) |
| 24 | } |
| 25 | |
| 26 | func getFuncName(fc interface{}) string { |
| 27 | reflectValue, ok := fc.(reflect.Value) |
no test coverage detected