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

     1  // +build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  func main() {
     8  	// START OMIT
     9  	type MyFloat64 float64
    10  	const Zero = 0.0
    11  	const TypedZero float64 = 0.0
    12  	var mf MyFloat64
    13  	mf = 0.0       // OK
    14  	mf = Zero      // OK
    15  	mf = TypedZero // Bad
    16  	fmt.Println(mf)
    17  	// STOP OMIT
    18  }