From 9c3eee0b00f068d5bab062d9a1716a40615c7a20 Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 30 May 2017 13:27:31 -0400 Subject: [PATCH] Makefile: add megacheck & some additional fixes --- Makefile | 9 ++++++++- cmd/tendermint/commands/root.go | 5 +---- consensus/byzantine_test.go | 5 +---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7848e4785..8c9c5214d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ GOTOOLS = \ github.com/mitchellh/gox \ - github.com/Masterminds/glide + github.com/Masterminds/glide \ + honnef.co/go/tools/cmd/megacheck + PACKAGES=$(shell go list ./... | grep -v '/vendor/') BUILD_TAGS?=tendermint TMHOME = $${TMHOME:-$$HOME/.tendermint} @@ -72,5 +74,10 @@ tools: ensure_tools: go get $(GOTOOLS) +### Formatting, linting, and vetting + +megacheck: + @for pkg in ${PACKAGES}; do megacheck "$$pkg"; done + .PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps revision tools diff --git a/cmd/tendermint/commands/root.go b/cmd/tendermint/commands/root.go index 3565f3bb8..a10ff3fca 100644 --- a/cmd/tendermint/commands/root.go +++ b/cmd/tendermint/commands/root.go @@ -31,9 +31,6 @@ var RootCmd = &cobra.Command{ config.SetRoot(config.RootDir) cfg.EnsureRoot(config.RootDir) logger, err = tmflags.ParseLogLevel(config.LogLevel, logger) - if err != nil { - return err - } - return nil + return err }, } diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index e779d6179..3a68a2f5d 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -117,10 +117,7 @@ func TestByzantine(t *testing.T) { p2p.Connect2Switches(switches, ind1, ind2) // wait for someone in the big partition to make a block - - select { - case <-eventChans[ind2]: - } + <-eventChans[ind2] t.Log("A block has been committed. Healing partition")