package main
func main() {

type greeting struct {
name string
}
// 定义结构体变量
var hello = greeting{name: "hello"}
fmt.Println(hello.name)
}

输出结果

hello