From 020f87f54d41a54e33512832c9f3121ba787db03 Mon Sep 17 00:00:00 2001 From: Junguk Cho Date: Mon, 22 Nov 2021 12:56:00 -0800 Subject: [PATCH 1/2] fix Nil pointer errors in NPMSimpleError --- npm/util/errors/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/util/errors/errors.go b/npm/util/errors/errors.go index 175c67f887..3f4aa33d3a 100644 --- a/npm/util/errors/errors.go +++ b/npm/util/errors/errors.go @@ -192,7 +192,7 @@ type NPMSimpleError struct { } func SimpleError(errstring string) *NPMSimpleError { - return nil + return &NPMSimpleError{fmt.Errorf("%s", errstring)} } func SimpleErrorWrapper(errstring string, err error) *NPMSimpleError { From 8db4303d5b893b2b41fe57a55fb714e3b18e063d Mon Sep 17 00:00:00 2001 From: Junguk Cho Date: Mon, 22 Nov 2021 13:49:38 -0800 Subject: [PATCH 2/2] Commented out lint error now --- npm/util/errors/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/util/errors/errors.go b/npm/util/errors/errors.go index 3f4aa33d3a..f9ded48f35 100644 --- a/npm/util/errors/errors.go +++ b/npm/util/errors/errors.go @@ -192,7 +192,7 @@ type NPMSimpleError struct { } func SimpleError(errstring string) *NPMSimpleError { - return &NPMSimpleError{fmt.Errorf("%s", errstring)} + return &NPMSimpleError{fmt.Errorf("%s", errstring)} //nolint:goerr113 // need to re-structure error handler in next PR } func SimpleErrorWrapper(errstring string, err error) *NPMSimpleError {