termbox-go-从控制台读取数据

I am very new to Go and went through some of the basic examples and literature around Go Lang. Currently I am working on a project where I need to create a terminal application. After reading around termbox-go we have decided to use the termbox-go as the base library for the development.

The application is very simple where the user will be provided with a set of menus as follows

Main Menu
---------
01) Menu 1
02) Menu 2
03) Menu 3
99) Quit

Please enter your selection : __

I am able to get the layout and all everything done after looking through the examples. But it no where I am not seeing any examples of where the selection is read from the terminal. The user will hit "Enter" key after the selection is done.

Can anyone can share an example which shows how to achieve the above.

Also is there any examples where the user screen has multiple input areas where user can move using up and down key and enter the values - as below

Enter Name : _____________
Enter DOB : ______________
Enter City: ______________

Any examples or pointers are highly appreciated.

Thanks

As for how users could enter text you could check out this example https://github.com/nsf/termbox-go/blob/master/_demos/editbox.go

In the example nothing happens when you press Enter but that's just because it's not handled in the main loop. Also you could expand this example with multiple edit boxes and map the up/down arrows to change which box has focus.