Skip to content

Commit

Permalink
fix gosec issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chimanjain committed May 10, 2024
1 parent a16c042 commit 8dfec37
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: securego/gosec@master
with:
# added additional exclude arguments after gosec v2.9.4 came out
args: -exclude=G402,G101 ./...
args: -exclude=G101,G402 ./...
malware_security_scan:
name: Malware Scanner
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func New(
}

if c.authType == authTypeSessionBased {
c.authenticate(ctx, username, password, hostname)
_ = c.authenticate(ctx, username, password, hostname)
}
resp := &apiVerResponse{}
if err := c.Get(ctx, "/platform/latest", "", nil, nil, resp); err != nil &&
Expand Down
4 changes: 2 additions & 2 deletions api/api_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func logRequest(_ context.Context, w io.Writer, req *http.Request, verbose Verbo
// full logging, i.e. print full request message content
buf, _ := httputil.DumpRequest(req, !isBinOctetBody(req.Header))
decodedBuf := encryptPassword(buf)
WriteIndented(w, decodedBuf)
_ = WriteIndented(w, decodedBuf)
fmt.Fprintln(w)
}
}
Expand Down Expand Up @@ -75,7 +75,7 @@ func logResponse(ctx context.Context, res *http.Response, verbose VerboseType) {
}

// when DumpResponse gets err, buf will be nil. No message content will be printed
WriteIndented(w, buf)
_ = WriteIndented(w, buf)

log.Debug(ctx, w.String())
}
Expand Down
2 changes: 1 addition & 1 deletion api/api_ordered_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (v *OrderedValues) Del(key []byte) {
// using insertion order.
func (v *OrderedValues) Encode() string {
buf := &bytes.Buffer{}
v.EncodeTo(buf)
_ = v.EncodeTo(buf)
return buf.String()
}

Expand Down
Loading

0 comments on commit 8dfec37

Please sign in to comment.