Skip to content

Commit

Permalink
Rename store.NewSQLStore to store.NewSQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juraj Bubniak committed Dec 30, 2019
1 parent d4e8ae3 commit fe94b3a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Health = &cli.Command{

func checkHealth(ctx *cli.Context) error {
cfg := config.LoadFromCLI(ctx)
st, err := store.NewSQLStore(cfg.DatabaseURL)
st, err := store.NewSQL(cfg.DatabaseURL)
if err != nil {
return fmt.Errorf("unable to initialize store: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var Server = &cli.Command{

func runServer(ctx *cli.Context) error {
cfg := config.LoadFromCLI(ctx)
st, err := store.NewSQLStore(cfg.DatabaseURL)
st, err := store.NewSQL(cfg.DatabaseURL)
if err != nil {
return fmt.Errorf("unable to initialize store: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/store/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *MockStore) GetLists(ctx context.Context) ([]domain.List, error) {
}

// Check checks the health of the store.
func (s *MockStore) Check() error {
func (s *MockStore) Check(ctx context.Context) error {
s.CheckCalled = true
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/store/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type list struct {
Items int64 `db:"items"`
}

// NewSQLStore returns new SQLStore.
func NewSQLStore(dataSource string) (*SQLStore, error) {
// NewSQL returns a new SQLStore.
func NewSQL(dataSource string) (*SQLStore, error) {
db, err := sqlx.Open("postgres", dataSource)
if err != nil {
return nil, err
Expand Down

0 comments on commit fe94b3a

Please sign in to comment.