[Go] Map syntax

Here is how typescript does the same thing

export type Data = {
  projector: {
    //pwd
    [key: string]: {
      // key        -> value
      [key: string]: string,
    }
  }
}

 

Here is the go version:

type Data struct {
    // [key]value, when serilize string make it lower case projector
	Projector map[string]map[string]string `json:"projector"`
}

 

posted @ 2024-02-29 19:54  Zhentiw  阅读(7)  评论(0)    收藏  举报