Skip to content

Commit

Permalink
Fix golint (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
aruiz14 authored Oct 24, 2018
1 parent b7a5a5c commit 0d086ae
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.8
- 1.11

os:
- linux
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ get-build-deps:
@echo "+ Downloading build dependencies"
@go get golang.org/x/tools/cmd/goimports
@go get github.com/tools/godep
@go get github.com/golang/lint/golint
@go get golang.org/x/lint/golint
@go get github.com/wadey/gocovmerge


Expand Down
1 change: 0 additions & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/bitnami/gonit/monitor"
"github.com/bitnami/gonit/utils"

"github.com/spf13/cobra"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import (
"runtime"
"syscall"

"github.com/VividCortex/godaemon"
"github.com/bitnami/gonit/log"
"github.com/bitnami/gonit/monitor"
"github.com/bitnami/gonit/utils"

"github.com/VividCortex/godaemon"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 1 addition & 2 deletions gonit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import (
"testing"
"time"

"github.com/bitnami/gonit/utils"

gt "github.com/bitnami/gonit/gonittest"
"github.com/bitnami/gonit/monitor"
tu "github.com/bitnami/gonit/testutils"
"github.com/bitnami/gonit/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down
3 changes: 1 addition & 2 deletions monitor/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import (
"sync"
"time"

"github.com/bitnami/gonit/utils"

"github.com/bitnami/gonit/log"
"github.com/bitnami/gonit/utils"
)

// CheckMaxStartTries defines a global default value for how many failed start attempts are made
Expand Down
3 changes: 1 addition & 2 deletions monitor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"encoding/json"
"fmt"
"net"
u "net/url"

"net/http"
u "net/url"
"time"
)

Expand Down
3 changes: 1 addition & 2 deletions monitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
"testing"
"time"

"github.com/bitnami/gonit/log"

gt "github.com/bitnami/gonit/gonittest"
"github.com/bitnami/gonit/log"
tu "github.com/bitnami/gonit/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
22 changes: 11 additions & 11 deletions utils/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestIsFile(t *testing.T) {
linkToDir: false,
brokenLink: false,
sb.Normalize("non-existent-path"): false,
file: true,
file: true,
} {
assert.Equal(t, IsFile(path), expected,
"Expected IsFile('%s') to be '%t'", path, expected)
Expand All @@ -35,11 +35,11 @@ func TestFileExists(t *testing.T) {
nonExistingFile := sb.TempFile()

for path, expected := range map[string]bool{
existingFile: true,
existingDir: true,
nonTraversableDir: true,
existingFile: true,
existingDir: true,
nonTraversableDir: true,
filepath.Join(nonTraversableDir, "dummy.txt"): false,
nonExistingFile: false,
nonExistingFile: false,
} {
assert.Equal(t, FileExists(path), expected,
"Expected FileExists('%s') to be '%t'", path, expected)
Expand Down Expand Up @@ -78,13 +78,13 @@ func TestIsWritableFile(t *testing.T) {
nonExistingFile := sb.TempFile()

for path, expected := range map[string]bool{
writableFile: true,
nonWritableFile: false,
writableDir: false,
filepath.Join(writableDir, "sample.txt"): true,
writableFile: true,
nonWritableFile: false,
writableDir: false,
filepath.Join(writableDir, "sample.txt"): true,
filepath.Join(nonWritableDir, "sample.txt"): false,
nonWritableDir: false,
nonExistingFile: true,
nonWritableDir: false,
nonExistingFile: true,
} {
assert.Equal(t, IsWritableFile(path), expected,
"Expected IsWritableFile('%s') to be '%t'", path, expected)
Expand Down

0 comments on commit 0d086ae

Please sign in to comment.