user input golang

import (
"fmt"
"bufio"
)

//reading an integer
var age int
fmt.Println("What is your age?") // Question to the user
_, err: fmt.Scan(&age)

//reading a string
reader := bufio.newReader(os.Stdin)
var name string
fmt.Println("What is your name?") // Question to the user
name, _ := reader.readString('\n')

fmt.Println("Your name is ", name, " and you are age ", age)
}

Are there any code examples left?
New code examples in category Go
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
golang on user input golang on input golang user input string how to get input from user using golang input en golang how to take user input in golang take user input goland read input golang read user input golang taking input from user in golang how to get input in golang get user input in go get specific user input golang how to take use input in go read input from user in golang golang read user input golang get input from user while output input from console golang how to take user input in GO programming how to get user input in golang reading input in golang how to take input golang read input with golang golang receive user input take input golang ask user for input golang input output golang sample input output golang taking input in go go input example go input golang get input from user console input golang user input go HOW TO READ INPUT GOLANG PASS INPUT GOLANG user input go lang take input in golang Golang input get input in go how to give user input in golang how to take input from user in golang taking user input in golang input in go golang input from user receiving input in golang how to take input in golang golang taking input from user input in golang get input in golang golang input text golang get user input golang input control golang take user input how to get input from user in golang enter golang fmt golang get input input string golang golang ask user for input golang user input how to get input golang golang read line console user input iin go take line of string input in golang take line input in golang how to get input go taking input in golang user input in golang get input golang get user input golang golang take text input golang scan command line golang read from command line how to get user input golang get user input in goolang gobyexample user input prompt user input golang input go lang promt user for input golang go read from keyboard string input golang take input from user golang go input output get input form cmd go lang input golang how to get input from cmd golan how to setup a user input golang golang read input how to read from stdin in go go read standard input go user input go string input go read input from user go command line input golang ask user input go prompt for input golang accept input Read input go get user input go user input golang
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source