mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:08:53 +08:00
fix: coding style and file format.
This commit is contained in:
@@ -14,6 +14,7 @@ func main() {
|
||||
fmt.Printf("The number of bytes in string str2 is %d\n", len(str2))
|
||||
fmt.Printf("The number of characters in string str2 is %d", utf8.RuneCountInString(str2))
|
||||
}
|
||||
|
||||
/* Output:
|
||||
The number of bytes in string str1 is 22
|
||||
The number of characters in string str1 is 22
|
||||
|
@@ -15,4 +15,5 @@ func f1() {
|
||||
func f2() {
|
||||
print(a) // global variable is taken
|
||||
}
|
||||
|
||||
// GOG
|
@@ -16,4 +16,5 @@ func m() {
|
||||
a = "O" // simple assignment: global a gets a new value
|
||||
print(a)
|
||||
}
|
||||
|
||||
// GOO
|
@@ -14,4 +14,5 @@ func m() {
|
||||
a := "O" // new local variable a is declared
|
||||
print(a)
|
||||
}
|
||||
|
||||
// GOG
|
Reference in New Issue
Block a user