Browse code

api: normalize comment formatting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/11/27 23:37:30
Showing 8 changed files
... ...
@@ -41,7 +41,7 @@ func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter,
41 41
 	}
42 42
 
43 43
 	config, _, _, err := s.decoder.DecodeConfig(r.Body)
44
-	if err != nil && err != io.EOF { //Do not fail if body is empty.
44
+	if err != nil && err != io.EOF { // Do not fail if body is empty.
45 45
 		return err
46 46
 	}
47 47
 
... ...
@@ -57,7 +57,7 @@ func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrite
57 57
 		}
58 58
 	}
59 59
 
60
-	if image != "" { //pull
60
+	if image != "" { // pull
61 61
 		metaHeaders := map[string][]string{}
62 62
 		for k, v := range r.Header {
63 63
 			if strings.HasPrefix(k, "X-Meta-") {
... ...
@@ -76,7 +76,7 @@ func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrite
76 76
 			}
77 77
 		}
78 78
 		err = s.backend.PullImage(ctx, image, tag, platform, metaHeaders, authConfig, output)
79
-	} else { //import
79
+	} else { // import
80 80
 		src := r.Form.Get("fromSrc")
81 81
 		// 'err' MUST NOT be defined within this block, we need any error
82 82
 		// generated from the download to be available to the output
... ...
@@ -211,7 +211,7 @@ func (pr *pluginRouter) createPlugin(ctx context.Context, w http.ResponseWriter,
211 211
 	if err := pr.backend.CreateFromContext(ctx, r.Body, options); err != nil {
212 212
 		return err
213 213
 	}
214
-	//TODO: send progress bar
214
+	// TODO: send progress bar
215 215
 	w.WriteHeader(http.StatusNoContent)
216 216
 	return nil
217 217
 }
... ...
@@ -30,7 +30,7 @@ type ContainerAttachConfig struct {
30 30
 // expectation is for the logger endpoints to assemble the chunks using this
31 31
 // metadata.
32 32
 type PartialLogMetaData struct {
33
-	Last    bool   //true if this message is last of a partial
33
+	Last    bool   // true if this message is last of a partial
34 34
 	ID      string // identifies group of messages comprising a single record
35 35
 	Ordinal int    // ordering of message in partial group
36 36
 }
... ...
@@ -265,7 +265,7 @@ type ImagePullOptions struct {
265 265
 // if the privilege request fails.
266 266
 type RequestPrivilegeFunc func() (string, error)
267 267
 
268
-//ImagePushOptions holds information to push images.
268
+// ImagePushOptions holds information to push images.
269 269
 type ImagePushOptions ImagePullOptions
270 270
 
271 271
 // ImageRemoveOptions holds parameters to remove images.
... ...
@@ -145,7 +145,7 @@ func (n NetworkMode) ConnectedContainer() string {
145 145
 	return ""
146 146
 }
147 147
 
148
-//UserDefined indicates user-created network
148
+// UserDefined indicates user-created network
149 149
 func (n NetworkMode) UserDefined() string {
150 150
 	if n.IsUserDefined() {
151 151
 		return string(n)
... ...
@@ -154,7 +154,7 @@ func (args Args) Len() int {
154 154
 func (args Args) MatchKVList(key string, sources map[string]string) bool {
155 155
 	fieldValues := args.fields[key]
156 156
 
157
-	//do not filter if there is no filter set or cannot determine filter
157
+	// do not filter if there is no filter set or cannot determine filter
158 158
 	if len(fieldValues) == 0 {
159 159
 		return true
160 160
 	}
... ...
@@ -200,7 +200,7 @@ func (args Args) Match(field, source string) bool {
200 200
 // ExactMatch returns true if the source matches exactly one of the values.
201 201
 func (args Args) ExactMatch(key, source string) bool {
202 202
 	fieldValues, ok := args.fields[key]
203
-	//do not filter if there is no filter set or cannot determine filter
203
+	// do not filter if there is no filter set or cannot determine filter
204 204
 	if !ok || len(fieldValues) == 0 {
205 205
 		return true
206 206
 	}
... ...
@@ -213,7 +213,7 @@ func (args Args) ExactMatch(key, source string) bool {
213 213
 // matches exactly the value.
214 214
 func (args Args) UniqueExactMatch(key, source string) bool {
215 215
 	fieldValues := args.fields[key]
216
-	//do not filter if there is no filter set or cannot determine filter
216
+	// do not filter if there is no filter set or cannot determine filter
217 217
 	if len(fieldValues) == 0 {
218 218
 		return true
219 219
 	}
... ...
@@ -13,7 +13,7 @@ type Address struct {
13 13
 // IPAM represents IP Address Management
14 14
 type IPAM struct {
15 15
 	Driver  string
16
-	Options map[string]string //Per network IPAM driver options
16
+	Options map[string]string // Per network IPAM driver options
17 17
 	Config  []IPAMConfig
18 18
 }
19 19