初级会员
  • 第 14992 位会员
  • ttbelieve
  • 2017-12-21 01:14:50
  • Offline
  • 20 23

最近发布的主题

最近发布的文章

最近分享的资源

    暂无

最近发布的项目

    暂无

最近的评论

  • ```sh map[1:11 2:22 AccessIPv4:instance.AccessIPv4 Fault:instance.Fault HostID:instanc e.HostID Progress:123 Status:instance.Status TenantID:instance.TenantID UserID:i nstance.UserID] Process finished with the exit code 0 ```
  • ```golang func MergeMap(mObj ...map[string]string) map[string]string { newObj := map[string]string{} for _, m := range mObj { for k, v := range m { newObj[k] = v } } return newObj } func main() { extraAttributesMap := map[string]string{ TenantIDKey: "instance.TenantID", UserIDKey: "instance.UserID", HostIDKey: "instance.HostID", StatusKey: "instance.Status", ProgressKey: "123", AccessIPv4Key: "instance.AccessIPv4", FaultKey: "instance.Fault", } Metadata := map[string]string{ "1": "11", "2": "22", } extraAttributes := MergeMap(extraAttributesMap, Metadata) fmt.Println(extraAttributes) } ```
  • ```golang func MergeMap(mObj ...map[string]string) map[string]string { newObj := map[string]string{} for _, m := range mObj { for k, v := range m { newObj[k] = v } } return newObj } ```