Skip to content

Commit

Permalink
Fix recent lint additions
Browse files Browse the repository at this point in the history
Signed-off-by: R.I.Pienaar <rip@devco.net>
  • Loading branch information
ripienaar committed Aug 14, 2024
1 parent 340dee0 commit e2bfd08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cli/account_tls_command.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The NATS Authors
// Copyright 2022-2024 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -65,7 +65,7 @@ func (c *ActTLSCmd) showTLS(_ *fisk.ParseContext) error {

var showingOCSP bool
if c.wantOCSP {
if t.OCSPResponse != nil && len(t.OCSPResponse) > 0 {
if len(t.OCSPResponse) > 0 {
showingOCSP = true
} else {
fmt.Printf("# No OCSP Response found in TLS connection\n\n")
Expand Down
3 changes: 2 additions & 1 deletion cli/errors_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package cli

import (
"encoding/json"
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -312,7 +313,7 @@ func (c *errCmd) validateErr(err *server.ErrorsData) error {
}

if len(errs) > 0 {
return fmt.Errorf(f(errs))
return errors.New(f(errs))
}

return nil
Expand Down
15 changes: 14 additions & 1 deletion top/toputils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2024 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package top

import (
Expand Down Expand Up @@ -102,7 +115,7 @@ func (e *Engine) doReq(path string, opts any) (*serverAPIResponse, error) {
}

if out.Error != nil {
return nil, fmt.Errorf(out.Error.Error())
return nil, errors.New(out.Error.Error())
}

return out, nil
Expand Down

0 comments on commit e2bfd08

Please sign in to comment.