Advertisement
cwchen

[Go] Using a variable

Sep 7th, 2017
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.22 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     // Declare the variable “name”.
  9.     var name string
  10.    
  11.     // Assign a string value to it.
  12.     name = "Michael"
  13.  
  14.     // Call the variable.
  15.     fmt.Println("Hello, ", name)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement