blob: f43feb63acab1cb80d97ae4d3ecd46757093c6cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// +build OMIT
package main
import "fmt"
func main() {
const Zero = 0.0
const TypedZero float64 = 0.0
// START OMIT
var f32 float32
f32 = 0.0
f32 = Zero // OK: Zero is untyped
f32 = TypedZero // Bad: TypedZero is float64 not float32.
fmt.Println(f32)
// STOP OMIT
}
|