func parsePriceLevels(minprice string, maxprice string, r *maps.TextSearchRequest) { if minprice != "" { r.MinPrice = parsePriceLevel(minprice) } if maxprice != "" { r.MaxPrice = parsePriceLevel(minprice) } }
func parseLocation(location string, r *maps.TextSearchRequest) { if location != "" { l, err := maps.ParseLatLng(location) check(err) r.Location = &l } }
func parsePlaceType(placeType string, r *maps.TextSearchRequest) { if placeType != "" { t, err := maps.ParsePlaceType(placeType) if err != nil { usageAndExit(fmt.Sprintf("Unknown place type \"%v\"", placeType)) } r.Type = t } }