package main
import "fmt"
func main(){
var b1 bool
b1 = true
fmt.Printf("%T,%t\n",b1,b1)
b2 := false
fmt.Printf("%T,%t\n",b1,b2)
var i1 int8
i1 = 100
fmt.Println(i1)
var i2 uint8
i2 = 200
fmt.Println(i2)
var i3 int
i3 = 1000
fmt.Println(i3)
var i5 uint8
i5 = 100
var i6 byte
i6 = i5
fmt.Println(i5,i6)
var i7 = 100
fmt.Println("%T,%d\n",i7,i7)
var f1 float32
f1 = 3.14
var f2 float64=4.67
fmt.Printf("%T,%.2f\n",f1,f1)
fmt.Printf("%T,%.3f\n",f2,f2)
fmt.Println(f1)
var f3 =100.12
fmt.Println(f3)
var s1 string
s1 = "asds"
fmt.Printf("%T,%s\n",s1,s1)
s2 := `hello`
fmt.Printf("%T,%s\n",s2,s2)
v1 := 'A'
v2 := "A"
fmt.Printf("%T,%d\n",v1,v1)
fmt.Printf("%T,%s\n",v2,v2)
v3 := "中文"
fmt.Printf("%T,%d,%c,%q\n",v3,v3,v3,v3)
fmt.Println("\"helloworld\"")
fmt.Println("hello\nwor\tld")
fmt.Println(`hell"owor"ld`)
var g int8
g = 10
var k int16
k = int16(g)
fmt.Println(g,k)
u := 4.88
o := int(u)
fmt.Println(u,o)
fn := 4.88
sum := f1+100
fmt.Println("%T,%f,%f\n",fn,sum,sum)
}
GOROOT=D:\Go #gosetup
GOPATH=D:\GO_WorkSpace #gosetup
D:\Go\bin\go.exe build -o C:\Users\lenovo\AppData\Local\Temp\___go_build_awesomeProject_src_hello__3_.exe D:/GO_WorkSpace/src/awesomeProject/src/hello/datatype.go #gosetup
C:\Users\lenovo\AppData\Local\Temp\___go_build_awesomeProject_src_hello__3_.exe #gosetup
bool,true
bool,false
100
200
1000
100 100
%T,%d
100 100
float32,3.14
float64,4.670
3.14
100.12
string,asds
string,hello
int32,65
string,A
string,%!d(string=中文),%!c(string=中文),"中文"
"helloworld"
hello
wor ld
hell"owor"ld
10 10
4.88 4
%T,%f,%f
4.88 103.14 103.14
Process finished with exit code 0