Advertisement
cwchen

[Go] Declaring a constant

Sep 7th, 2017
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.18 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     // Declarethe the constant PI and assign it a value.
  9.     const PI = 3.14159
  10.  
  11.     // Call the variable.
  12.     fmt.Println("PI: ", PI)
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement