|
@@ -12,7 +12,24 @@ func testStrings() {
|
|
fmt.Println(fixed)
|
|
fmt.Println(fixed)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func testString() {
|
|
|
|
+ v := "Hello"
|
|
|
|
+ for i, c := range v {
|
|
|
|
+ fmt.Printf("%d of '%s\n", i, string(c))
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ emoji := []rune("cool")
|
|
|
|
+ for _, ch := range emoji {
|
|
|
|
+ fmt.Printf("%d of '%s'\n", ch, string(ch))
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func testSlice() {
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
func main() {
|
|
func main() {
|
|
|
|
+ testString()
|
|
/*
|
|
/*
|
|
var price int = 100.0
|
|
var price int = 100.0
|
|
fmt.Println("Price is", price, "dollars.")
|
|
fmt.Println("Price is", price, "dollars.")
|
|
@@ -35,6 +52,6 @@ func main() {
|
|
fmt.Println("Today is", year, "year")
|
|
fmt.Println("Today is", year, "year")
|
|
fmt.Println("Now is", time.Now())
|
|
fmt.Println("Now is", time.Now())
|
|
*/
|
|
*/
|
|
- test_error()
|
|
|
|
|
|
+ // test_error()
|
|
// testStrings()
|
|
// testStrings()
|
|
}
|
|
}
|