Skip to content

Commit

Permalink
Use relative imports
Browse files Browse the repository at this point in the history
This project already uses go modules but still depends on the $GOPATH
in its imports. This commit should remove this dependency and allow for
the use of relative paths in imports.
  • Loading branch information
kohrVid committed May 15, 2022
1 parent 6d57856 commit e05c9d2
Show file tree
Hide file tree
Showing 14 changed files with 2,161 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vendor/*
!vendor/.gitkeep
!vendor/modules.txt
pg-cli
*.cov
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,11 @@ Apply all down migrations:

Clone the repo:

mkdir -p $GOPATH/src/github.com/kohrVid/
cd $GOPATH/src/github.com/kohrVid/
git clone https://github.com/kohrVid/pg-cli.git
cd pg-cli

Clone dependencies:
Install dependencies:

cd $GOPATH/src/github.com/kohrVid/pg-cli
go mod vendor

Run tests:
Expand Down
3 changes: 2 additions & 1 deletion cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ package cmd
import (
"fmt"

"github.com/kohrVid/pg-cli/db"
"pg-cli/db"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ package cmd
import (
"fmt"

"github.com/kohrVid/pg-cli/db"
"pg-cli/db"

_ "github.com/lib/pq"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
3 changes: 2 additions & 1 deletion cmd/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package cmd
import (
"fmt"

"pg-cli/db"

_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/golang-migrate/migrate/v4/source/github"
"github.com/kohrVid/pg-cli/db"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ package cmd
import (
"fmt"

"github.com/kohrVid/pg-cli/db"
"pg-cli/db"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/migrate_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package cmd
import (
"fmt"

"pg-cli/db"

_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/golang-migrate/migrate/v4/source/github"
"github.com/kohrVid/pg-cli/db"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ package cmd
import (
"fmt"

"github.com/kohrVid/pg-cli/db"
"pg-cli/db"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package cmd
import (
"fmt"

"pg-cli/db"

_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/golang-migrate/migrate/v4/source/github"
"github.com/kohrVid/pg-cli/db"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package cmd
import (
"fmt"

"pg-cli/db"

_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/golang-migrate/migrate/v4/source/github"
"github.com/kohrVid/pg-cli/db"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
42 changes: 25 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
module github.com/kohrVid/pg-cli
module pg-cli

go 1.17

require (
github.com/gertd/go-pluralize v0.1.7
github.com/golang-migrate/migrate/v4 v4.15.1
github.com/lib/pq v1.10.4
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.9.0
github.com/stretchr/testify v1.7.0
github.com/gertd/go-pluralize v0.2.1
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/lib/pq v1.10.5
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.11.0
github.com/stretchr/testify v1.7.1
go.lsp.dev/uri v0.3.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/google/go-github/v35 v35.2.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-github/v39 v39.2.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20220126234351-aa10faf2a1f8 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace github.com/kohrVid/pg-cli v0.1.1 => pg-cli v0.1.1
Loading

0 comments on commit e05c9d2

Please sign in to comment.