(writer io.Writer, ppl PackagePopularityList)
| 15 | ) |
| 16 | |
| 17 | func PrintPackagePopularities(writer io.Writer, ppl PackagePopularityList) { |
| 18 | w := tabwriter.NewWriter(writer, minWidth, 0, padding, ' ', 0) |
| 19 | for _, pkg := range ppl.PackagePopularities { |
| 20 | fmt.Fprintf(w, "%s\t%.2f\n", pkg.Name, pkg.Popularity) |
| 21 | } |
| 22 | w.Flush() |
| 23 | |
| 24 | if ppl.Count > 0 && ppl.Total > 0 { |
| 25 | fmt.Fprintf(writer, "\n%d of %d results\n", ppl.Count, ppl.Total) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func PrintSearchURL(writer io.Writer, baseURL string, query string) { |
| 30 | if len(query) > 0 { |
no outgoing calls