Skip to content

Commit

Permalink
Fix some style issues (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislas-m committed Jun 26, 2019
1 parent b6770e4 commit 8f45961
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ gin-bin
tsoda
migrations/schema.sql
.grifter/
cockroach-data/
vendor/
go.mod
go.sum

# test data
cockroach-data/
2 changes: 1 addition & 1 deletion associations/has_many_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (a *hasManyAssociation) AfterProcess() AssociationStatement {
ownerIDFieldName := "ID"
ownerID := reflect.Indirect(reflect.ValueOf(a.owner)).FieldByName(ownerIDFieldName).Interface()

ids := []interface{}{}
var ids []interface{}

for i := 0; i < v.Len(); i++ {
id := v.Index(i).FieldByName(belongingIDFieldName).Interface()
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gobuffalo/envy"
"github.com/gobuffalo/pop/logging"
"github.com/pkg/errors"
yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v2"
)

// ErrConfigFileNotFound is returned when the pop config file can't be found,
Expand Down
12 changes: 6 additions & 6 deletions dialect_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ func genericExec(s store, stmt string, args ...interface{}) (sql.Result, error)
}

func genericSelectOne(s store, model *Model, query Query) error {
sql, args := query.ToSQL(model)
log(logging.SQL, sql, args...)
err := s.Get(model.Value, sql, args...)
sqlQuery, args := query.ToSQL(model)
log(logging.SQL, sqlQuery, args...)
err := s.Get(model.Value, sqlQuery, args...)
if err != nil {
return err
}
return nil
}

func genericSelectMany(s store, models *Model, query Query) error {
sql, args := query.ToSQL(models)
log(logging.SQL, sql, args...)
err := s.Select(models.Value, sql, args...)
sqlQuery, args := query.ToSQL(models)
log(logging.SQL, sqlQuery, args...)
err := s.Select(models.Value, sqlQuery, args...)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion fix/auto_timestamps_off_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

packr "github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/packr/v2"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion model.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (m *Model) fieldByName(s string) (reflect.Value, error) {
el := reflect.ValueOf(m.Value).Elem()
fbn := el.FieldByName(s)
if !fbn.IsValid() {
return fbn, fmt.Errorf("Model does not have a field named %s", s)
return fbn, fmt.Errorf("model does not have a field named %s", s)
}
return fbn, nil
}
Expand Down
2 changes: 1 addition & 1 deletion slices/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (f Float) Interface() interface{} {
func (f *Float) Scan(src interface{}) error {
b, ok := src.([]byte)
if !ok {
return errors.New("Scan source was not []byte")
return errors.New("scan source was not []byte")
}
str := string(b)
*f = strToFloat(str)
Expand Down
2 changes: 1 addition & 1 deletion slices/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (i Int) Interface() interface{} {
func (i *Int) Scan(src interface{}) error {
b, ok := src.([]byte)
if !ok {
return errors.New("Scan source was not []byte")
return errors.New("scan source was not []byte")
}
str := string(b)
*i = strToInt(str)
Expand Down
2 changes: 1 addition & 1 deletion slices/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (m Map) Interface() interface{} {
func (m *Map) Scan(src interface{}) error {
b, ok := src.([]byte)
if !ok {
return errors.New("Scan source was not []byte")
return errors.New("scan source was not []byte")
}
err := json.Unmarshal(b, m)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion slices/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (s UUID) Interface() interface{} {
func (s *UUID) Scan(src interface{}) error {
b, ok := src.([]byte)
if !ok {
return errors.New("Scan source was not []byte")
return errors.New("scan source was not []byte")
}
us, err := strSliceToUUIDSlice(strToUUID(string(b)))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion soda/cmd/generate/fizz_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var FizzCmd = &cobra.Command{
Short: "Generates Up/Down migrations for your database using fizz.",
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("You must supply a name for your migration")
return errors.New("you must supply a name for your migration")
}
cflag := cmd.Flag("path")
migrationPath := defaults.String(cflag.Value.String(), "./migrations")
Expand Down
2 changes: 1 addition & 1 deletion soda/cmd/generate/sql_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var SQLCmd = &cobra.Command{
Short: "Generates Up/Down migrations for your database using SQL.",
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("You must supply a name for your migration")
return errors.New("you must supply a name for your migration")
}
cflag := cmd.Flag("path")
migrationPath := defaults.String(cflag.Value.String(), "./migrations")
Expand Down

0 comments on commit 8f45961

Please sign in to comment.