Created
July 13, 2017 21:09
-
-
Save jeffotoni/7d31f976569b5d1dfd7f7f2ee0810639 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "strings" | |
| ) | |
| func main() { | |
| reader := bufio.NewReader(os.Stdin) | |
| // Prompt and read | |
| fmt.Print("Nome: ") | |
| text, _ := reader.ReadString('\n') | |
| fmt.Print("Namorada: ") | |
| text2, _ := reader.ReadString('\n') | |
| // Trim whitespace and print | |
| fmt.Printf("Nome: \"%s\", Namorada \"%s\"\n", | |
| strings.TrimSpace(text), strings.TrimSpace(text2)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment