func joinSegmentsGCMap(segments []*openflights.GetMilesResponse_Segment) string { segmentStrings := make([]string, len(segments)) for i, segment := range segments { segmentStrings[i] = fmt.Sprintf("%s-%s", segment.SourceAirportId, segment.DestinationAirportId) } return template.URLQueryEscaper(strings.Join(segmentStrings, "\r\n")) }
func main() { flag.Parse() url := template.URLQueryEscaper(flag.Args()) url = fmt.Sprintf("http://52.68.184.19:8080/search/%s", url) fmt.Printf("open %s\n", url) open.Start(url) }
// URLQueryEscaper returns the escaped value of the textual representation of // its arguments in a form suitable for embedding in a URL query. func URLQueryEscaper(args ...interface{}) string { return template.URLQueryEscaper(args...) }