diff --git a/.gitignore b/.gitignore index b273b5a9..adb521c0 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,9 @@ gin-bin tsoda migrations/schema.sql .grifter/ -cockroach-data/ vendor/ go.mod go.sum + +# test data +cockroach-data/ diff --git a/associations/has_many_association.go b/associations/has_many_association.go index fddc5bee..463d0796 100644 --- a/associations/has_many_association.go +++ b/associations/has_many_association.go @@ -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() diff --git a/config.go b/config.go index ab4a2f29..48440fac 100644 --- a/config.go +++ b/config.go @@ -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, diff --git a/dialect_common.go b/dialect_common.go index 75a6a395..01799d07 100644 --- a/dialect_common.go +++ b/dialect_common.go @@ -112,9 +112,9 @@ 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 } @@ -122,9 +122,9 @@ func genericSelectOne(s store, model *Model, query Query) error { } 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 } diff --git a/fix/auto_timestamps_off_test.go b/fix/auto_timestamps_off_test.go index 4438e635..315f6d24 100644 --- a/fix/auto_timestamps_off_test.go +++ b/fix/auto_timestamps_off_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - packr "github.com/gobuffalo/packr/v2" + "github.com/gobuffalo/packr/v2" "github.com/stretchr/testify/require" ) diff --git a/model.go b/model.go index 90c1f01b..d6d74c4b 100644 --- a/model.go +++ b/model.go @@ -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 } diff --git a/slices/float.go b/slices/float.go index 77dfb441..70035ca0 100644 --- a/slices/float.go +++ b/slices/float.go @@ -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) diff --git a/slices/int.go b/slices/int.go index ee9b6e55..3659cecc 100644 --- a/slices/int.go +++ b/slices/int.go @@ -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) diff --git a/slices/map.go b/slices/map.go index 97ac24c6..deed3189 100644 --- a/slices/map.go +++ b/slices/map.go @@ -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 { diff --git a/slices/uuid.go b/slices/uuid.go index 19cbfdff..25b2f75d 100644 --- a/slices/uuid.go +++ b/slices/uuid.go @@ -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 { diff --git a/soda/cmd/generate/fizz_cmd.go b/soda/cmd/generate/fizz_cmd.go index 96b5226e..09f3f8c7 100644 --- a/soda/cmd/generate/fizz_cmd.go +++ b/soda/cmd/generate/fizz_cmd.go @@ -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") diff --git a/soda/cmd/generate/sql_cmd.go b/soda/cmd/generate/sql_cmd.go index 9ed1f843..cd8ba96f 100644 --- a/soda/cmd/generate/sql_cmd.go +++ b/soda/cmd/generate/sql_cmd.go @@ -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")