// when using either ":=" or "var" without a type
// type is inferred based on type of the rvalue in
// case rvalue is a variable, or the precision
// required to represent rvalue in case rvalue is
// a constant.
package main
import "fmt"
func main() {
x := 3
y := 42.0
fmt.Printf("Type: %T Value: %v\n", x, x)
fmt.Printf("Type: %T Value: %v\n", y, y)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: