DisplayString returns the function ID as a suitable display name. For example, the output will generally look like: "func_name(param1, param2)"
()
| 331 | // DisplayString returns the function ID as a suitable display name. |
| 332 | // For example, the output will generally look like: "func_name(param1, param2)" |
| 333 | func (id Function) DisplayString() string { |
| 334 | if !id.IsValid() { |
| 335 | return "" |
| 336 | } |
| 337 | params := make([]string, id.ParameterCount()) |
| 338 | for i, paramID := range id.Parameters() { |
| 339 | params[i] = paramID.TypeName() |
| 340 | } |
| 341 | return fmt.Sprintf("%s(%s)", id.FunctionName(), strings.Join(params, ", ")) |
| 342 | } |
| 343 | |
| 344 | // FunctionName returns the function's name. |
| 345 | func (id Function) FunctionName() string { |
no test coverage detected