示例#1
0
func (this *Struct) String() string {
	if this == nil {
		return "nil"
	}
	keysForFields := make([]string, 0, len(this.Fields))
	for k := range this.Fields {
		keysForFields = append(keysForFields, k)
	}
	github_com_maditya_protobuf_sortkeys.Strings(keysForFields)
	mapStringForFields := "map[string]*Value{"
	for _, k := range keysForFields {
		mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k])
	}
	mapStringForFields += "}"
	s := strings.Join([]string{`&Struct{`,
		`Fields:` + mapStringForFields + `,`,
		`}`,
	}, "")
	return s
}
示例#2
0
func (this *Struct) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 5)
	s = append(s, "&types.Struct{")
	keysForFields := make([]string, 0, len(this.Fields))
	for k := range this.Fields {
		keysForFields = append(keysForFields, k)
	}
	github_com_maditya_protobuf_sortkeys.Strings(keysForFields)
	mapStringForFields := "map[string]*Value{"
	for _, k := range keysForFields {
		mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k])
	}
	mapStringForFields += "}"
	if this.Fields != nil {
		s = append(s, "Fields: "+mapStringForFields+",\n")
	}
	s = append(s, "}")
	return strings.Join(s, "")
}