gobyexample/002-values.go
Mark McGranaghan b943fcfb74 fix
2012-09-20 22:15:58 -07:00

27 lines
604 B
Go

package main // Go has various value types, including strings,
// different types of numbers, booleans, etc.
import "fmt"
func main() {
fmt.Println("Hello world") // Strings.
fmt.Println("Hello " + "other")
fmt.Println("1+1 =", 1+1) // Integers and floats.
fmt.Println("7.0/3.0 =", 7.0/3.0)
fmt.Println(true && false) // Booleans.
fmt.Println(true || false)
fmt.Println(!true)
}
/*
$ go run values.go
Hello world
Hello other
1+1 = 2
7.0/3.0 = 2.3333333333333335
false
true
false
*/