Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(597)

Delta Between Two Patch Sets: environs/imagemetadata/generate.go

Issue 81570045: cleanup: fixing go vet warnings
Left Patch Set: Created 10 years ago
Right Patch Set: cleanup: fixing go vet warnings Created 10 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/plugins/juju-restore/restore.go ('k') | environs/imagemetadata/validation.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package imagemetadata 4 package imagemetadata
5 5
6 import ( 6 import (
7 "bytes" 7 "bytes"
8 "fmt" 8 "fmt"
9 "path/filepath" 9 "path/filepath"
10 "time" 10 "time"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 var allCloudSpecs = []simplestreams.CloudSpec{*cloudSpec} 66 var allCloudSpecs = []simplestreams.CloudSpec{*cloudSpec}
67 for _, im := range existingMetadata { 67 for _, im := range existingMetadata {
68 if _, ok := imageIds[mapKey(im)]; ok { 68 if _, ok := imageIds[mapKey(im)]; ok {
69 continue 69 continue
70 } 70 }
71 toWrite = append(toWrite, im) 71 toWrite = append(toWrite, im)
72 if _, ok := regions[im.RegionName]; ok { 72 if _, ok := regions[im.RegionName]; ok {
73 continue 73 continue
74 } 74 }
75 regions[im.RegionName] = true 75 regions[im.RegionName] = true
76 » » existingCloudSpec := simplestreams.CloudSpec{Region: im.RegionNa me, Endpoint: im.Endpoint} 76 » » existingCloudSpec := simplestreams.CloudSpec{
77 » » » Region: im.RegionName,
78 » » » Endpoint: im.Endpoint,
79 » » }
77 allCloudSpecs = append(allCloudSpecs, existingCloudSpec) 80 allCloudSpecs = append(allCloudSpecs, existingCloudSpec)
78 } 81 }
79 return toWrite, allCloudSpecs 82 return toWrite, allCloudSpecs
80 } 83 }
81 84
82 type MetadataFile struct { 85 type MetadataFile struct {
83 Path string 86 Path string
84 Data []byte 87 Data []byte
85 } 88 }
86 89
(...skipping 12 matching lines...) Expand all
99 } 102 }
100 for _, md := range metadataInfo { 103 for _, md := range metadataInfo {
101 err = metadataStore.Put( 104 err = metadataStore.Put(
102 filepath.Join(storage.BaseImagesPath, md.Path), bytes.Ne wReader(md.Data), int64(len(md.Data))) 105 filepath.Join(storage.BaseImagesPath, md.Path), bytes.Ne wReader(md.Data), int64(len(md.Data)))
103 if err != nil { 106 if err != nil {
104 return err 107 return err
105 } 108 }
106 } 109 }
107 return nil 110 return nil
108 } 111 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b