// Chapter 15 example: fmt.Print keeps the cursor on the same line as the prompt. // Run with: go run exercises/15/02-prompt-same-line.go package main import ( "bufio" "fmt" "os" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) fmt.Print("What is your name? ") text, _ := reader.ReadString('\n') name := strings.TrimSpace(text) fmt.Println("Hello, " + name) }