mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 07:23:28 +08:00
15 lines
228 B
Go
Executable File
15 lines
228 B
Go
Executable File
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}
|
|
} |