Skip to content

Commit

Permalink
Fix errcheck warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Weiss <[email protected]>
  • Loading branch information
antweiss committed Feb 26, 2020
1 parent 8ad839f commit 63368c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/setup-go@v1
with:
go-version: ${{ secrets.GO_VERSION }}
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck ./...
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -exclude errcheck_excludes.txt ./...
static_check:
name: Static check
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions errcheck_excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(io.Closer).Close
(*os.File).Close
(*github.com/layer5io/meshery-linkerd/linkerd.YAMLDecoder).Close
13 changes: 6 additions & 7 deletions linkerd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,12 @@ func (iClient *Client) execute(command ...string) (string, string, error) {
var outb, errb bytes.Buffer
cmd.Stdout = &outb
cmd.Stderr = &errb
// err = cmd.Run()
cmd.Run()
// if err != nil {
// err = errors.Wrapf(err, "error while executing requested command")
// logrus.Error(err)
// return "", "", err
// }

err = cmd.Run()
if err != nil {
err = errors.Wrapf(err, "error while executing requested command")
logrus.Error(err)
}
logrus.Debugf("Received output: %s", outb.String())
logrus.Debugf("Received error: %s", errb.String())
return outb.String(), errb.String(), nil
Expand Down

0 comments on commit 63368c3

Please sign in to comment.