This is a workaround to get the requires_username field nested inside Options field.
(ctx context.Context, s string)
| 1043 | |
| 1044 | // This is a workaround to get the requires_username field nested inside Options field. |
| 1045 | func (c *cli) getConnReqUsername(ctx context.Context, s string) *bool { |
| 1046 | conn, err := c.api.Connection.ReadByName(ctx, s) |
| 1047 | if err != nil { |
| 1048 | fmt.Println(err) |
| 1049 | } |
| 1050 | res := fmt.Sprintln(conn.Options) |
| 1051 | |
| 1052 | opts := &management.ConnectionOptions{} |
| 1053 | if err := json.Unmarshal([]byte(res), &opts); err != nil { |
| 1054 | fmt.Println(err) |
| 1055 | } |
| 1056 | |
| 1057 | return opts.RequiresUsername |
| 1058 | } |
| 1059 | |
| 1060 | func (c *cli) userImportEditorHint() { |
| 1061 | c.renderer.Infof("%s Once you close the editor, the user(s) will be imported. To cancel, CTRL+C.", ansi.Faint("Hint:")) |
no test coverage detected