chore: fix comment typos (#480)

pull/479/head^2
Andreas Deininger 2023-03-15 01:01:38 +01:00 committed by GitHub
parent c462979327
commit 15ef2bcb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -136,7 +136,7 @@ func TestCustomBinary(t *testing.T) {
} }
t.Cleanup(func() { t.Cleanup(func() {
if err := os.Remove("./go.db"); err != nil { if err := os.Remove("./go.db"); err != nil {
t.Logf("failed to remove %s resouces: %v", t.Name(), err) t.Logf("failed to remove %s resources: %v", t.Name(), err)
} }
}) })
@ -160,7 +160,7 @@ func TestEmbeddedMigrations(t *testing.T) {
} }
t.Cleanup(func() { t.Cleanup(func() {
if err := os.Remove("./sql_embed.db"); err != nil { if err := os.Remove("./sql_embed.db"); err != nil {
t.Logf("failed to remove %s resouces: %v", t.Name(), err) t.Logf("failed to remove %s resources: %v", t.Name(), err)
} }
}) })

View File

@ -91,7 +91,7 @@ func parseInitFunc(fd *ast.FuncDecl) (*goMigration, error) {
getNameFromExpr := func(expr ast.Expr) (string, error) { getNameFromExpr := func(expr ast.Expr) (string, error) {
arg, ok := expr.(*ast.Ident) arg, ok := expr.(*ast.Ident)
if !ok { if !ok {
return "", fmt.Errorf("failed to assert argument identifer: got %T", arg) return "", fmt.Errorf("failed to assert argument identifier: got %T", arg)
} }
return arg.Name, nil return arg.Name, nil
} }

View File

@ -86,7 +86,7 @@ func (ms Migrations) versioned() (Migrations, error) {
// assume that the user will never have more than 19700101000000 migrations // assume that the user will never have more than 19700101000000 migrations
for _, m := range ms { for _, m := range ms {
// parse version as timestmap // parse version as timestamp
versionTime, err := time.Parse(timestampFormat, fmt.Sprintf("%d", m.Version)) versionTime, err := time.Parse(timestampFormat, fmt.Sprintf("%d", m.Version))
if versionTime.Before(time.Unix(0, 0)) || err != nil { if versionTime.Before(time.Unix(0, 0)) || err != nil {
@ -103,7 +103,7 @@ func (ms Migrations) timestamped() (Migrations, error) {
// assume that the user will never have more than 19700101000000 migrations // assume that the user will never have more than 19700101000000 migrations
for _, m := range ms { for _, m := range ms {
// parse version as timestmap // parse version as timestamp
versionTime, err := time.Parse(timestampFormat, fmt.Sprintf("%d", m.Version)) versionTime, err := time.Parse(timestampFormat, fmt.Sprintf("%d", m.Version))
if err != nil { if err != nil {
// probably not a timestamp // probably not a timestamp