AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.08k stars 351 forks source link

Write OptionAnswer value to non interface{} map #293

Closed infalmo closed 4 years ago

infalmo commented 4 years ago

Hello! Basically, the commit enables to write just the string value (or index) of an option selected in survey.Select{} to a map of strings/ints. This is achieved by passing a map[string]string or map[string]int instead of map[string]interface{} .

Also, thanks a lot for this wonderful package!

infalmo commented 4 years ago

@coryb @AlecAivazis Could you please review this PR, and suggest changes if any?

AlecAivazis commented 4 years ago

Hey @infixint943! Would you mind writing a test that covers this change? I am having a hard time following the exact situation you are trying to address.

infalmo commented 4 years ago

@AlecAivazis I have added tests. I would be very thankful if you reviewed them!

infalmo commented 4 years ago

Any updates @AlecAivazis?