Function
TitleSurvey
(p Prompt, io *iostreams.IOStreams, state *IssueMetadataState)
Source from the content-addressed store, hash-verified
| 114 | } |
| 115 | |
| 116 | func TitleSurvey(p Prompt, io *iostreams.IOStreams, state *IssueMetadataState) error { |
| 117 | var err error |
| 118 | result := "" |
| 119 | for result == "" { |
| 120 | result, err = p.Input("Title (required)", state.Title) |
| 121 | if err != nil { |
| 122 | return err |
| 123 | } |
| 124 | if result == "" { |
| 125 | fmt.Fprintf(io.ErrOut, "%s Title cannot be blank\n", io.ColorScheme().FailureIcon()) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | if result != state.Title { |
| 130 | state.MarkDirty() |
| 131 | } |
| 132 | |
| 133 | state.Title = result |
| 134 | |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | type MetadataFetcher struct { |
| 139 | IO *iostreams.IOStreams |