all: lint fixes for "should omit 2nd value from range"

Change-Id: I7bb19d376f96a39ecae7dbdb4d6808f704bae5fb
This commit is contained in:
Paul Lindner 2017-12-10 16:35:57 -08:00
parent e97eae91dc
commit ba92702834
10 changed files with 11 additions and 11 deletions

View File

@ -43,7 +43,7 @@ type varMap map[string][]pos
func sortedKeys(m varMap) []string {
keys := make([]string, 0, len(m))
for k, _ := range m {
for k := range m {
keys = append(keys, k)
}
sort.Strings(keys)

View File

@ -434,7 +434,7 @@ func packBinaries(ctxDir string) {
binaries["cammount"] = false
}
toPack := func(bin string) bool {
for k, _ := range binaries {
for k := range binaries {
if bin == k {
binaries[k] = true
return true

View File

@ -89,7 +89,7 @@ func (c *Client) RemoveBlob(b blob.Ref) error {
func stringKeys(m map[string]bool) (s []string) {
s = make([]string, 0, len(m))
for key, _ := range m {
for key := range m {
s = append(s, key)
}
return

View File

@ -300,7 +300,7 @@ func (h *DeployHandler) refreshZones() error {
defer h.zonesMu.Unlock()
defer func() {
h.regions = make([]string, 0, len(h.zones))
for r, _ := range h.zones {
for r := range h.zones {
h.regions = append(h.regions, r)
}
}()

View File

@ -104,7 +104,7 @@ Content-Type: application/json; charset=UTF-8
apiURL, photosetAPIPath, page, photosetId, fakeUserId)
response := fmt.Sprintf("%s%s", okHeader, fakePhotoset(photosetId, page, pages, photoIds[pageStart:pageEnd]))
responses[photosURL] = httputil.StaticResponder(response)
for k, _ := range photoIds {
for k := range photoIds {
if k < pageEnd {
continue
}

View File

@ -223,7 +223,7 @@ func newFromConfig(ld blobserver.Loader, cfg jsonconfig.Obj) (http.Handler, erro
}
ClientId := make(map[string]string)
ClientSecret := make(map[string]string)
for k, _ := range importers {
for k := range importers {
var clientId, clientSecret string
if impConf := cfg.OptionalObject(k); impConf != nil {
clientId = impConf.OptionalString("clientID", "")

View File

@ -143,7 +143,7 @@ func (ix *Index) indexReadyBlobs() {
}
ix.Lock()
defer ix.Unlock()
for br, _ := range failed {
for br := range failed {
ix.readyReindex[br] = true
}
}

View File

@ -221,7 +221,7 @@ func DeepParseDeps(r io.Reader) (map[string][]string, error) {
}
return jsfiles
}
for namespace, _ := range providedBy {
for namespace := range providedBy {
filesDeps[namespace] = deeperDeps(namespace)
}
return filesDeps, nil

View File

@ -502,7 +502,7 @@ func (dh *DownloadHandler) serveZip(w http.ResponseWriter, r *http.Request) {
h.Set("Content-Disposition", "attachment; filename="+zipName)
zw := zip.NewWriter(w)
dh.r = r
for br, _ := range allRefs {
for br := range allRefs {
if err := dh.zipFile("", br, zw); err != nil {
log.Printf("error zipping %v: %v", br, err)
// http.Error is of no use since we've already started sending a response

View File

@ -120,12 +120,12 @@ func testInsertLarge(t *testing.T, kv sorted.KeyValue) {
largeKey := make([]byte, sorted.MaxKeySize-1)
// setting all the bytes because postgres whines about an invalid byte sequence
// otherwise
for k, _ := range largeKey {
for k := range largeKey {
largeKey[k] = 'A'
}
largeKey[sorted.MaxKeySize-2] = 'B'
largeValue := make([]byte, sorted.MaxValueSize-1)
for k, _ := range largeValue {
for k := range largeValue {
largeValue[k] = 'A'
}
largeValue[sorted.MaxValueSize-2] = 'B'