diff --git a/cli/account_tls_command.go b/cli/account_tls_command.go index 4bdfce03..1aaf5295 100644 --- a/cli/account_tls_command.go +++ b/cli/account_tls_command.go @@ -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 @@ -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") diff --git a/cli/errors_command.go b/cli/errors_command.go index c46de2c0..a8c05d44 100644 --- a/cli/errors_command.go +++ b/cli/errors_command.go @@ -15,6 +15,7 @@ package cli import ( "encoding/json" + "errors" "fmt" "os" "os/exec" @@ -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 diff --git a/top/toputils.go b/top/toputils.go index 26695dc0..d31f7a8b 100644 --- a/top/toputils.go +++ b/top/toputils.go @@ -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 ( @@ -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