Browse code

Add GoDoc to fix linting validation

The validate step in CI was broken, due to a combination of
086b4541cf9d27d9c2654f316a6f69b0d9caedd9, fbdd437d295595e88466b33a550a8707b9ebb709,
and 85733620ebea3da75abe7d732043354aa0883f8a being merged to master.

```
api/types/filters/parse.go:39:1: exported method `Args.Keys` should have comment or be unexported (golint)
func (args Args) Keys() []string {
^
daemon/config/builder.go:19:6: exported type `BuilderGCFilter` should have comment or be unexported (golint)
type BuilderGCFilter filters.Args
^
daemon/config/builder.go:21:1: exported method `BuilderGCFilter.MarshalJSON` should have comment or be unexported (golint)
func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) {
^
daemon/config/builder.go:35:1: exported method `BuilderGCFilter.UnmarshalJSON` should have comment or be unexported (golint)
func (x *BuilderGCFilter) UnmarshalJSON(data []byte) error {
^
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9d726f1c18216a127572310fccb0fab8fcfdc678)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/10/22 04:34:05
Showing 2 changed files
... ...
@@ -36,6 +36,7 @@ func NewArgs(initialArgs ...KeyValuePair) Args {
36 36
 	return args
37 37
 }
38 38
 
39
+// Keys returns all the keys in list of Args
39 40
 func (args Args) Keys() []string {
40 41
 	keys := make([]string, 0, len(args.fields))
41 42
 	for k := range args.fields {
... ...
@@ -16,8 +16,10 @@ type BuilderGCRule struct {
16 16
 	KeepStorage string          `json:",omitempty"`
17 17
 }
18 18
 
19
+// BuilderGCFilter contains garbage-collection filter rules for a BuildKit builder
19 20
 type BuilderGCFilter filters.Args
20 21
 
22
+// MarshalJSON returns a JSON byte representation of the BuilderGCFilter
21 23
 func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) {
22 24
 	f := filters.Args(*x)
23 25
 	keys := f.Keys()
... ...
@@ -32,6 +34,7 @@ func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) {
32 32
 	return json.Marshal(arr)
33 33
 }
34 34
 
35
+// UnmarshalJSON fills the BuilderGCFilter values structure from JSON input
35 36
 func (x *BuilderGCFilter) UnmarshalJSON(data []byte) error {
36 37
 	var arr []string
37 38
 	f := filters.NewArgs()