(name string, args []reflect.Type)
| 26 | } |
| 27 | |
| 28 | func validateRoundFunc(name string, args []reflect.Type) (reflect.Type, error) { |
| 29 | if len(args) != 1 { |
| 30 | return anyType, fmt.Errorf("invalid number of arguments (expected 1, got %d)", len(args)) |
| 31 | } |
| 32 | switch kind(args[0]) { |
| 33 | case reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Interface: |
| 34 | return floatType, nil |
| 35 | default: |
| 36 | return anyType, fmt.Errorf("invalid argument for %s (type %s)", name, args[0]) |
| 37 | } |
| 38 | } |
no test coverage detected
searching dependent graphs…