This is a creation in Article, where the information may have evolved or changed. Go has various value types including strings, integers, floats, booleans, etc. Here is a few basic examples.
Strings, which can added together with +
integers and floats.
Booleans, with the Boolean operators as you ' d expect.
Package Mainimport "FMT" Func Main () { fmt. Println ("Go" + "lang") FMT. Println ("+ =", "+") FMT. Println ("7.0/3.0 =", 7.0/3.0) FMT. Println (True && false) FMT. Println (True | | false) FMT. Println (!true)}
$ go Run values.go
Golang
+ = 2
7.0/3.0 = 2.3333333333333335
False
True
False
Translated:
There are many different value types in the Go language, including strings, integers, float, Boolean, etc. Here are some basic examples
Package Mainimport "FMT" Func Main () { fmt. Println ("Go" + "lang") FMT. Println ("+ =", "+") FMT. Println ("7.0/3.0 =", 7.0/3.0) FMT. Println (True && false) FMT. Println (True | | false) FMT. Println (!true)}$ go run values.gogolang1+1 = 27.0/3.0 = 2.3333333333333335falsetruefalse
Original address