GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-golang
/
01_hello
Browse code
Update type.go
master
1 parent
9bfaab4
commit
f14966bb5b2c69cddd3e04f76be3be0a68281e10
yhornisse
authored
on 22 Sep 2021
Patch
Showing
1 changed file
type.go
Ignore Space
Show notes
View
type.go
package main import "fmt" type A int64 type B int64 func main() { var i int64 = 1 var a1 A = 1 var a2 A = 1 var b1 B = 1 fmt.Printf("%d %d %d %d %d\n", i, int64(a1), a1, a2, b1) fmt.Printf("a1 == 1: %+v\n", a1 == 1) //fmt.Printf("a1 == i: %+v\n", a1 == i) // build error fmt.Printf("int64(a1) == i: %+v\n", int64(a1) == i) fmt.Printf("a1 == a2: %+v\n", a1 == a2) //fmt.Printf("a1 == b1: %+v\n", a1 == b1) // build error }
package main import "fmt" type A int64 type B int64 func main() { var i int64 = 1 var a1 A = 1 var a2 A = 1 var b1 B = 1 fmt.Printf("%d %d %d %d %d\n", i, int64(a1), a1, a2, b1) fmt.Printf("a1 == 1: %+v\n", a1 == 1) //fmt.Printf("a1 == i: %+v\n", a1 == i) fmt.Printf("int64(a1) == i: %+v\n", int64(a1) == i) fmt.Printf("a1 == a2: %+v\n", a1 == a2) //fmt.Printf("a1 == b1: %+v\n", a1 == b1) }
Show line notes below