trim up
This commit is contained in:
parent
0606feeea7
commit
c179a25a6a
@ -7,8 +7,7 @@ import "fmt"
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println("Hello world") // Strings - you already saw these.
|
fmt.Println("Hello world") // Strings - you already saw these.
|
||||||
fmt.Println("Hello World"[1])
|
fmt.Println("Hello " + "other")
|
||||||
fmt.Println("Hello " + "World")
|
|
||||||
|
|
||||||
fmt.Println("1+1 =", 1+1) // Integers and floats.
|
fmt.Println("1+1 =", 1+1) // Integers and floats.
|
||||||
fmt.Println("7.0/3.0 =", 7.0/3.0)
|
fmt.Println("7.0/3.0 =", 7.0/3.0)
|
||||||
@ -18,5 +17,13 @@ func main() {
|
|||||||
fmt.Println(!true)
|
fmt.Println(!true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is just a sampling of Go's value types. We'll
|
/*
|
||||||
// learn more about them as we go.
|
$ go run 02-values.go
|
||||||
|
Hello world
|
||||||
|
Hello other
|
||||||
|
1+1 = 2
|
||||||
|
7.0/3.0 = 2.3333333333333335
|
||||||
|
false
|
||||||
|
true
|
||||||
|
false
|
||||||
|
*/
|
||||||
|
@ -7,6 +7,7 @@ func p(o interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
p("hello"[0])
|
||||||
p(strings.Contains("test", "es"))
|
p(strings.Contains("test", "es"))
|
||||||
p(strings.Count("test", "t"))
|
p(strings.Count("test", "t"))
|
||||||
p(strings.HasPrefix("test", "te"))
|
p(strings.HasPrefix("test", "te"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user