Go language-fmt.Scan

fmt.Scan I'm going to write the understanding of Go from the basics of programming!


var input string
fmt.Scan(&input)  //❶fmt.scan(&Variable name)Enter characters on the console with

Go  //❷ Input character string → ❸ Value Go entered in variable input is assigned

Input on the console is possible using fmt.Scan (& variable name) The input value is assigned to the variable input

Input flow

func main() {
  var input string
fmt.Println("Please enter the following words:go") //❶
fmt.Scan(&input)              //❷
fmt.Printf("%s was entered", input)   //❸

//❶ Enter the following words:go 
//❷go(Type in console)            
//❸ entered

You can use fmt.Scan to input

Recommended Posts

Go language-fmt.Scan
Go language-address
Go Language-Functions
Go language-pointer
Go Language-Basic ❷
GO Chokisomemo 1
Go language-iteration
Python with Go
Go language-conditional branching
About Go functions
Go language-standard package
Go class basics
Go language-rand package
About Go Interface
use go module