Shadowing package variable
package main
import (
"fmt"
)
var x float32 = 3.14
func main() {
fmt.Printf("%v %T\n", x, x)
x := 23
fmt.Printf("%v %T\n", x, x)
}
3.14 float32
23 int
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
package main
import (
"fmt"
)
var x float32 = 3.14
func main() {
fmt.Printf("%v %T\n", x, x)
x := 23
fmt.Printf("%v %T\n", x, x)
}
3.14 float32
23 int