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
Merge branch 'master' of https://pied-piper.net/gitbucket/git/sample-golang/01_hello
master
commit
b17086ff69f531742701e7c5d7257778316ad172
2 parents
cabd8cf
+
f14966b
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