// Since we're using "structs" to turn our Resource structures into maps, we need to
// pull the "structs" tags to find the actual field names
Since we're using "structs" to turn our Resource structures into maps, we need to
pull the "structs" tags to find the actual field names
// Since we ' re using " structs " to turn our Resource structures into maps we need to // pull the " structs " tags to find the actual field names
func extractActualNamesFromTags(restype reflect.Type) map[string]string {
	result := make(map[string]string)
	for i := 0; i < restype.NumField(); i++ {
		f := restype.Field(i)
		structsTag := f.Tag.Get("structs")
		if structsTag != "" {
			result[strings.Split(structsTag, ",")[0]] = f.Name
		}
	}
	return result
}
func extractActualNamesFromTags ( restype reflect . Type ) map [ string ] string { result := make ( map [ string ] string ) for i := 0 ; i < restype . NumField ( ) ; i ++ { f := restype . Field ( i ) structsTag := f . Tag . Get ( " " ) if structsTag != " " { result [ strings . Split ( structsTag , " " ) [ 0 ] ] = f . Name } } return result }
Since we're using "structs" to turn our Resource structures into maps, we need to
pull the "structs" tags to find the actual field names
Since we ' re using " structs " to turn our Resource structures into maps we need to pull the " structs " tags to find the actual field names