package main
import (
"fmt"
)
type Test struct {
Name string
Pid map[string]*CPCPrice
}
type CPCPrice struct {
Price map[string]uint32
}
func main() {
dataA := make(map[string]*CPCPrice)
priceA := make(map[string]uint32)
priceA["sousuo"] = uint32(10)
priceA["zhanshi"] = uint32(20)
//fmt.Println(priceA)
t := Test{}
t.Pid["test"].Price = priceA
fmt.Println(t)
}
t.Pid = make(map[string]*CPCPrice, 0)
t.Pid["test"] = new(CPCPrice)
t.Pid["test"].Price = priceA
#1
更多评论
func main() {
dataA := make(map[string]*CPCPrice)
priceA := make(map[string]uint32)
priceA["sousuo"] = uint32(10)
priceA["zhanshi"] = uint32(20)
t := Test{Pid:dataA}
t.Pid["test"] = &CPCPrice{
Price: priceA,
}
fmt.Println(t, dataA)
}
#2