Skip to content

Commit 20bb5c5

Browse files
chore: golangci-lint fixes
1 parent eadede4 commit 20bb5c5

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ linters:
4545
- nlreturn
4646
- prealloc
4747
- nilerr
48-
- nolintlint
4948
- rowserrcheck
5049
# - scopelint --> exportloopref
5150
- exportloopref

pg_dump.go

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func NewDump(pg *Postgres) (*Dump, error) {
3838
if !CommandExist(PGDumpCmd) {
3939
return nil, &ErrCommandNotFound{Command: PGDumpCmd}
4040
}
41+
4142
return &Dump{Options: pgDumpStdOpts, Postgres: pg}, nil
4243
}
4344

pg_dump_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import (
55
"runtime"
66
"testing"
77

8+
. "github.com/smartystreets/goconvey/convey"
9+
10+
pg "github.com/habx/pg-commands"
811
"github.com/habx/pg-commands/tests/fixtures"
912
initdatabase "github.com/habx/pg-commands/tests/fixtures/scripts/init-database"
1013
deps "github.com/habx/pg-commands/tests/fixtures/scripts/install-deps"
11-
12-
pg "github.com/habx/pg-commands"
13-
14-
. "github.com/smartystreets/goconvey/convey"
1514
)
1615

16+
// nolint: gochecknoinits
1717
func init() {
1818
initdatabase.Init()
1919
if runtime.GOOS == "linux" {

pg_restore.go

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func NewRestore(pg *Postgres) (*Restore, error) {
3232
if !CommandExist(PGRestoreCmd) {
3333
return nil, &ErrCommandNotFound{Command: PGRestoreCmd}
3434
}
35+
3536
return &Restore{Options: pgDRestoreStdOpts, Postgres: pg, Schemas: []string{"public"}}, nil
3637
}
3738

pg_restore_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/habx/pg-commands/tests/fixtures"
7+
. "github.com/smartystreets/goconvey/convey"
88

99
pg "github.com/habx/pg-commands"
10-
11-
. "github.com/smartystreets/goconvey/convey"
10+
"github.com/habx/pg-commands/tests/fixtures"
1211
)
1312

1413
func TestNewRestoreWrongCommand(t *testing.T) {
@@ -67,6 +66,7 @@ func TestRestore(t *testing.T) {
6766
if restore.Role != "" {
6867
return fmt.Sprintf("--role=%s ", restore.Role)
6968
}
69+
7070
return ""
7171
}(),
7272
result.File))

tests/fixtures/postgres.go

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
const PostgresPort = 5432
1111

1212
func Setup() *pg.Postgres {
13-
1413
pgHost := "localhost"
1514
if os.Getenv("HABX_ENV") == "test" && os.Getenv("CI") == "true" {
1615
pgHost = "postgres"

utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ func streamExecOutput(out io.ReadCloser, options ExecOptions) string {
2929
}
3030
func CommandExist(command string) bool {
3131
_, err := exec.LookPath(command)
32+
3233
return err == nil
3334
}

utils_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package pgcommands_test
33
import (
44
"testing"
55

6-
pg "github.com/habx/pg-commands"
7-
86
. "github.com/smartystreets/goconvey/convey"
7+
8+
pg "github.com/habx/pg-commands"
99
)
1010

1111
func CommandExistTest(t *testing.T) {

0 commit comments

Comments
 (0)