Skip to content

Commit 031f83c

Browse files
committed
linting
1 parent 0bbee68 commit 031f83c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pkg/registry/registry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func New(schemaLocation string, strict bool, skipTLS bool) (Registry, error) {
8080

8181
if strings.HasPrefix(schemaLocation, "http") {
8282
return newHTTPRegistry(schemaLocation, strict, skipTLS), nil
83-
} else {
84-
return newLocalRegistry(schemaLocation, strict), nil
8583
}
84+
85+
return newLocalRegistry(schemaLocation, strict), nil
8686
}

pkg/resource/stream.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import (
77
"io"
88
)
99

10-
// Thank you https://github.com/helm/helm-classic/blob/master/codec/yaml.go#L90
10+
// SplitYAMLDocument is a bufio.SplitFunc for splitting a YAML document into individual documents.
11+
//
12+
// This is from Kubernetes' 'pkg/util/yaml'.splitYAMLDocument, which is unfortunately
13+
// not exported.
1114
func SplitYAMLDocument(data []byte, atEOF bool) (advance int, token []byte, err error) {
1215
const yamlSeparator = "\n---"
1316
if atEOF && len(data) == 0 {

pkg/validator/validator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ func (val *v) ValidateResource(res resource.Resource) Result {
157157
if schema == nil {
158158
if val.opts.IgnoreMissingSchemas {
159159
return Result{Resource: res, Err: nil, Status: Skipped}
160-
} else {
161-
return Result{Resource: res, Err: fmt.Errorf("could not find schema for %s", sig.Kind), Status: Error}
162160
}
161+
162+
return Result{Resource: res, Err: fmt.Errorf("could not find schema for %s", sig.Kind), Status: Error}
163163
}
164164

165165
resourceLoader := gojsonschema.NewGoLoader(r)

0 commit comments

Comments
 (0)