From 1265c5a3da16d1a4df18be246c9b5476fb948a77 Mon Sep 17 00:00:00 2001 From: Isabella Siu Date: Wed, 18 Sep 2024 14:35:45 -0400 Subject: [PATCH] Fix golangci-lint errors (#353) --- pkg/models/setting.go | 2 +- pkg/sitewise/auth.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/models/setting.go b/pkg/models/setting.go index a71cf69d..a5b79d21 100644 --- a/pkg/models/setting.go +++ b/pkg/models/setting.go @@ -22,7 +22,7 @@ type AWSSiteWiseDataSourceSetting struct { } func (s *AWSSiteWiseDataSourceSetting) Load(config backend.DataSourceInstanceSettings) error { - if config.JSONData != nil && len(config.JSONData) > 1 { + if len(config.JSONData) > 1 { if err := json.Unmarshal(config.JSONData, s); err != nil { return fmt.Errorf("could not unmarshal DatasourceSettings json: %w", err) } diff --git a/pkg/sitewise/auth.go b/pkg/sitewise/auth.go index f3975b03..bd7c43fd 100644 --- a/pkg/sitewise/auth.go +++ b/pkg/sitewise/auth.go @@ -70,7 +70,7 @@ func (a *EdgeAuthenticator) Authenticate() (models.AuthInfo, error) { for i, asn1Data := range rawCerts { cert, err := x509.ParseCertificate(asn1Data) if err != nil { - return fmt.Errorf("tls: failed to parse certificate from server: " + err.Error()) + return fmt.Errorf("tls: failed to parse certificate from server: %w", err) } certs[i] = cert }