Skip to content

Commit

Permalink
add a few more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Oct 19, 2024
1 parent da2f52c commit 7f35867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
linters:
disable-all: true
enable:
- testifylint
# Default
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- gofmt
# Added
- testifylint
- misspell
8 changes: 4 additions & 4 deletions provider_collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func newSQLMigration(source Source) *Migration {
}
}

func merge(sources *fileSources, registerd map[int64]*Migration) ([]*Migration, error) {
func merge(sources *fileSources, registered map[int64]*Migration) ([]*Migration, error) {
var migrations []*Migration
migrationLookup := make(map[int64]*Migration)
// Add all SQL migrations to the list of migrations.
Expand All @@ -123,7 +123,7 @@ func merge(sources *fileSources, registerd map[int64]*Migration) ([]*Migration,
migrationLookup[source.Version] = m
}
// If there are no Go files in the filesystem and no registered Go migrations, return early.
if len(sources.goSources) == 0 && len(registerd) == 0 {
if len(sources.goSources) == 0 && len(registered) == 0 {
return migrations, nil
}
// Return an error if the given sources contain a versioned Go migration that has not been
Expand All @@ -133,7 +133,7 @@ func merge(sources *fileSources, registerd map[int64]*Migration) ([]*Migration,
// This is almost always a user error.
var unregistered []string
for _, s := range sources.goSources {
m, ok := registerd[s.Version]
m, ok := registered[s.Version]
if !ok {
unregistered = append(unregistered, s.Path)
} else {
Expand All @@ -151,7 +151,7 @@ func merge(sources *fileSources, registerd map[int64]*Migration) ([]*Migration,
// migrations may not have a corresponding file on disk. Which is fine! We include them
// wholesale as part of migrations. This allows users to build a custom binary that only embeds
// the SQL migration files.
for version, r := range registerd {
for version, r := range registered {
// Ensure there are no duplicate versions.
if existing, ok := migrationLookup[version]; ok {
fullpath := r.Source
Expand Down

0 comments on commit 7f35867

Please sign in to comment.