From f4907a9863b3fe1a3586a6366047f8041b623528 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 25 Oct 2019 15:45:37 +0300 Subject: [PATCH] Fix typos in variables --- bindata_test.go | 8 ++++---- migrate.go | 10 +++++----- sqlparse/sqlparse_test.go | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bindata_test.go b/bindata_test.go index b4321b82..323ffe2a 100644 --- a/bindata_test.go +++ b/bindata_test.go @@ -68,8 +68,8 @@ func test_migrations_2_record_sql() ([]byte, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { return f() } return nil, fmt.Errorf("Asset %s not found", name) @@ -105,8 +105,8 @@ var _bindata = map[string]func() ([]byte, error){ func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { diff --git a/migrate.go b/migrate.go index a829211a..4e814fa5 100644 --- a/migrate.go +++ b/migrate.go @@ -33,20 +33,20 @@ var numberPrefixRegex = regexp.MustCompile(`^(\d+).*$`) // of already applied migrations and the currently found. For example, when the database // contains a migration which is not among the migrations list found for an operation. type PlanError struct { - Migration *Migration - ErrorMessag string + Migration *Migration + ErrorMessage string } func newPlanError(migration *Migration, errorMessage string) error { return &PlanError{ - Migration: migration, - ErrorMessag: errorMessage, + Migration: migration, + ErrorMessage: errorMessage, } } func (p *PlanError) Error() string { return fmt.Sprintf("Unable to create migration plan because of %s: %s", - p.Migration.Id, p.ErrorMessag) + p.Migration.Id, p.ErrorMessage) } // TxError is returned when any error is encountered during a database diff --git a/sqlparse/sqlparse_test.go b/sqlparse/sqlparse_test.go index 89c87092..0f3f8a7c 100644 --- a/sqlparse/sqlparse_test.go +++ b/sqlparse/sqlparse_test.go @@ -82,7 +82,7 @@ func (s *SqlParseSuite) TestSplitStatements(c *C) { } func (s *SqlParseSuite) TestIntentionallyBadStatements(c *C) { - for _, test := range intenionallyBad { + for _, test := range intentionallyBad { _, err := ParseMigration(strings.NewReader(test)) c.Assert(err, NotNil) } @@ -187,7 +187,7 @@ DROP TABLE fancier_post; ` // raise error when statements are not explicitly ended -var intenionallyBad = []string{ +var intentionallyBad = []string{ // first statement missing terminator `-- +migrate Up CREATE TABLE post (