lean into examples

This commit is contained in:
Mark McGranaghan
2012-10-09 21:02:12 -07:00
parent 5d1775bdaa
commit 8daa226a48
130 changed files with 4 additions and 4 deletions

21
examples/values/values.go Normal file
View File

@@ -0,0 +1,21 @@
// Go has various value types, including strings,
// different types of numbers, booleans, etc.
package main
import "fmt"
func main() {
// Here are some strings, which can be added together.
fmt.Println("Hello world")
fmt.Println("Hello " + "other")
// Some examples of integers and floats.
fmt.Println("1+1 =", 1+1)
fmt.Println("7.0/3.0 =", 7.0/3.0)
// And booleans, which work as you'd expect.
fmt.Println(true && false)
fmt.Println(true || false)
fmt.Println(!true)
}

View File

@@ -0,0 +1,8 @@
$ go run values.go
Hello world
Hello other
1+1 = 2
7.0/3.0 = 2.3333333333333335
false
true
false