mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:21:38 +08:00
fix: coding style and file format for chapter 10.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type C struct {
|
||||
x float32;
|
||||
int;
|
||||
string;
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := C{3.14, 7, "hello"}
|
||||
fmt.Println(c.x, c.int, c.string) // output: 3.14 7 hello
|
||||
fmt.Println(c) // output: {3.14 7 hello}
|
||||
}
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type C struct {
|
||||
x float32
|
||||
int
|
||||
string
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := C{3.14, 7, "hello"}
|
||||
fmt.Println(c.x, c.int, c.string) // output: 3.14 7 hello
|
||||
fmt.Println(c) // output: {3.14 7 hello}
|
||||
}
|
||||
|
Reference in New Issue
Block a user