Skip to content

Commit

Permalink
Removing static analysis failures
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Jul 29, 2016
1 parent 5f38a4f commit c85787f
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 41 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ migrate-perf:
@go run main.go migrate -c ./config/perf.yaml

static:
@go vet $(PACKAGES)
@-go vet $(PACKAGES)
@-gocyclo -over 5 . | egrep -v vendor/
@#golint
@for pkg in $$(go list ./... |grep -v /vendor/) ; do \
@for pkg in $$(go list ./... | grep -v /vendor/ | grep -v "/db") ; do \
golint $$pkg ; \
done
@#ineffassign
Expand Down
9 changes: 0 additions & 9 deletions api/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,9 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/topfreegames/khan/models"
)

var _ = Describe("Healthcheck API Handler", func() {
var testDb models.DB

BeforeEach(func() {
var err error
testDb, err = GetTestDB()
Expect(err).NotTo(HaveOccurred())
})

Describe("Healthcheck Handler", func() {
It("Should respond with default WORKING string", func() {
a := GetDefaultTestApp()
Expand Down
9 changes: 0 additions & 9 deletions api/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,9 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/topfreegames/khan/models"
)

var _ = Describe("Status API Handler", func() {
var testDb models.DB

BeforeEach(func() {
var err error
testDb, err = GetTestDB()
Expect(err).NotTo(HaveOccurred())
})

Describe("Status Handler", func() {
It("Should respond with status", func() {
a := GetDefaultTestApp()
Expand Down
14 changes: 1 addition & 13 deletions cmd/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/topfreegames/khan/cmd"
"github.com/topfreegames/khan/models"
)

// GetTestDB returns a connection to the test database
func GetTestDB() (models.DB, error) {
return models.GetDB("localhost", "khan_test", 5432, "disable", "khan_test", "")
}

func dropDB() error {
cmd := exec.Cmd{
Dir: "../",
Expand All @@ -38,14 +32,8 @@ func dropDB() error {
}

var _ = Describe("Migrate Command", func() {
var testDb models.DB

BeforeEach(func() {
var err error
testDb, err = GetTestDB()
Expect(err).NotTo(HaveOccurred())

err = dropDB()
err := dropDB()
Expect(err).NotTo(HaveOccurred())
})

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {
)
}

// initConfig reads in config file and ENV variables if set.
// InitConfig reads in config file and ENV variables if set.
func InitConfig() {
if ConfigFile != "" { // enable ability to specify config file via flag
viper.SetConfigFile(ConfigFile)
Expand Down
3 changes: 0 additions & 3 deletions models/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import (

var _ = Describe("Hook Model", func() {
var testDb DB
var faultyDb DB

BeforeEach(func() {
var err error
testDb, err = GetTestDB()
Expect(err).NotTo(HaveOccurred())

faultyDb = GetFaultyTestDB()
})

Describe("Hook Model", func() {
Expand Down
3 changes: 0 additions & 3 deletions models/membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ import (

var _ = Describe("Hook Model", func() {
var testDb DB
var faultyDb DB

BeforeEach(func() {
var err error
testDb, err = GetTestDB()
Expect(err).NotTo(HaveOccurred())

faultyDb = GetFaultyTestDB()
})

Describe("Membership Model", func() {
Expand Down

0 comments on commit c85787f

Please sign in to comment.