(label string, a ...interface{})
| 58 | } |
| 59 | |
| 60 | func PromptString(label string, a ...interface{}) (string, error) { |
| 61 | validate := func(input string) error { |
| 62 | if len(input) == 0 { |
| 63 | return errors.New("empty input not allowed") |
| 64 | } |
| 65 | return nil |
| 66 | } |
| 67 | |
| 68 | prompt := promptui.Prompt{ |
| 69 | Label: fmt.Sprintf(label, a...), |
| 70 | Validate: validate, |
| 71 | } |
| 72 | result, err := prompt.Run() |
| 73 | if err != nil { |
| 74 | return "", err |
| 75 | } |
| 76 | return result, nil |
| 77 | } |
| 78 | |
| 79 | func PrintWebsocketMessage(_ int, msg []byte) error { |
| 80 | fmt.Println(util.SanitizeLogEntry(string(msg))) |
no test coverage detected