golang.org/toolchain@v0.0.1-go1.9rc2.windows-amd64/blog/content/constants/int1.go (about)

     1  // +build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  func main() {
     8  	// START OMIT
     9  	type MyInt int
    10  	const Three = 3
    11  	const TypedThree int = 3
    12  	var mi MyInt
    13  	mi = 3          // OK
    14  	mi = Three      // OK
    15  	mi = TypedThree // Bad
    16  	fmt.Println(mi)
    17  	// STOP OMIT
    18  }