update golangci-lint v1.49.0

This commit is contained in:
yugo kobayashi
2022-09-22 12:56:15 +00:00
parent e62480d11c
commit 401cf9579c
15 changed files with 49 additions and 41 deletions

View File

@@ -82,7 +82,7 @@ type KRMFunctionVersion struct {
type KRMFunctionValidation struct {
// OpenAPIV3Schema is the OpenAPI v3 schema for an instance of the KRM function.
OpenAPIV3Schema *spec.Schema `yaml:"openAPIV3Schema,omitempty" json:"openAPIV3Schema,omitempty"` // nolint: tagliatelle
OpenAPIV3Schema *spec.Schema `yaml:"openAPIV3Schema,omitempty" json:"openAPIV3Schema,omitempty"` //nolint: tagliatelle
}
type KRMFunctionNames struct {

View File

@@ -34,7 +34,7 @@ func (c *Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
}
func (c *Filter) Run(reader io.Reader, writer io.Writer) error {
cmd := exec.Command(c.Path, c.Args...) // nolint:gosec
cmd := exec.Command(c.Path, c.Args...) //nolint:gosec
cmd.Stdin = reader
cmd.Stdout = writer
cmd.Stderr = os.Stderr

View File

@@ -204,7 +204,7 @@ func (s *StorageMount) String() string {
func GetFunctionSpec(n *yaml.RNode) (*FunctionSpec, error) {
meta, err := n.GetMeta()
if err != nil {
return nil, nil
return nil, fmt.Errorf("failed to get ResourceMeta: %w", err)
}
fn, err := getFunctionSpecFromAnnotation(n, meta)
@@ -237,7 +237,10 @@ func getFunctionSpecFromAnnotation(n *yaml.RNode, meta yaml.ResourceMeta) (*Func
}
}
n, err := n.Pipe(yaml.Lookup("metadata", "configFn"))
if err != nil || yaml.IsMissingOrNull(n) {
if err != nil {
return nil, fmt.Errorf("failed to LookUp configFn: %w", err)
}
if yaml.IsMissingOrNull(n) {
return nil, nil
}
s, err := n.String()