mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
fix(internal): errorlint linter
#### Description errorlint linter in internal Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
9b22aa4e05
commit
abecafa0f5
4 changed files with 6 additions and 4 deletions
|
|
@ -152,7 +152,7 @@ func validateChartVersion(cf *chart.Metadata) error {
|
|||
valid, msg := c.Validate(version)
|
||||
|
||||
if !valid && len(msg) > 0 {
|
||||
return fmt.Errorf("version %v", msg[0])
|
||||
return fmt.Errorf("version %w", msg[0])
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ func LoadFile(name string) (*chart.Chart, error) {
|
|||
c, err := LoadArchive(raw)
|
||||
if err != nil {
|
||||
if errors.Is(err, gzip.ErrHeader) {
|
||||
return nil, fmt.Errorf("file '%s' does not appear to be a valid chart file (details: %s)", name, err)
|
||||
return nil, fmt.Errorf("file '%s' does not appear to be a valid chart file (details: %w)", name, err)
|
||||
}
|
||||
}
|
||||
return c, err
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
package v3
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
@ -181,7 +182,7 @@ func TestValidate(t *testing.T) {
|
|||
|
||||
for _, tt := range tests {
|
||||
result := tt.md.Validate()
|
||||
if result != tt.err {
|
||||
if !errors.Is(result, tt.err) {
|
||||
t.Errorf("expected %q, got %q in test %q", tt.err, result, tt.name)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import (
|
|||
"archive/tar"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
|
@ -64,7 +65,7 @@ func TestLocalInstallerNotAFolder(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
if err != ErrPluginNotADirectory {
|
||||
if !errors.Is(err, ErrPluginNotADirectory) {
|
||||
t.Fatalf("expected error to equal: %q", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue