Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Add GoDoc to fix linting validation
Browse files Browse the repository at this point in the history
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>
Upstream-commit: e5a0bc6a50ef924ed6c0f333693857ab22ca47fa
Component: engine
  • Loading branch information
thaJeztah committed Oct 22, 2019
1 parent ff0c0a3 commit b2a43ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/engine/api/types/filters/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewArgs(initialArgs ...KeyValuePair) Args {
return args
}

// Keys returns all the keys in list of Args
func (args Args) Keys() []string {
keys := make([]string, 0, len(args.fields))
for k := range args.fields {
Expand Down
3 changes: 3 additions & 0 deletions components/engine/daemon/config/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ type BuilderGCRule struct {
KeepStorage string `json:",omitempty"`
}

// BuilderGCFilter contains garbage-collection filter rules for a BuildKit builder
type BuilderGCFilter filters.Args

// MarshalJSON returns a JSON byte representation of the BuilderGCFilter
func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) {
f := filters.Args(*x)
keys := f.Keys()
Expand All @@ -32,6 +34,7 @@ func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) {
return json.Marshal(arr)
}

// UnmarshalJSON fills the BuilderGCFilter values structure from JSON input
func (x *BuilderGCFilter) UnmarshalJSON(data []byte) error {
var arr []string
f := filters.NewArgs()
Expand Down

0 comments on commit b2a43ee

Please sign in to comment.