Skip to content

Instantly share code, notes, and snippets.

@inancgumus
Last active December 2, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inancgumus/9a0bb392e135334c51260015b904148a to your computer and use it in GitHub Desktop.
Save inancgumus/9a0bb392e135334c51260015b904148a to your computer and use it in GitHub Desktop.
// https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3
package main
import (
"fmt"
)
const (
Mercury = 3.303e+23
Venus = 4.869e+24
Earth = 5.976e+24
Mars = 6.421e+23
Jupiter = 1.9e+27
Saturn = 5.688e+26
Uranus = 8.686e+25
Neptune = 1.024e+26
)
func main() {
fmt.Println("Mercury's mass is", Mercury)
fmt.Println("Jupiter's mass is", Jupiter)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment