Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add consumer migration tool #226

Merged
merged 18 commits into from
Mar 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: fix nolint
guseggert committed Mar 27, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
guseggert Gus Eggert
commit 2ff161faf9d656d5101d739458bf0c6321883484
5 changes: 3 additions & 2 deletions cmd/migrate/internal/migrator.go
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ func (m *Migrator) updateFileImports(filePath string) error {
if err != nil {
return err
}
defer f.Close()
err = format.Node(f, fset, astFile)
if err != nil {
f.Close()
@@ -120,7 +121,7 @@ func (m *Migrator) FindMigratedDependencies() ([]string, error) {
}
} else {
if !strings.Contains(stderr, "not a known dependency") {
return nil, fmt.Errorf("non-zero exit code %d finding if current module depends on %q, stderr:\n%s\n", exitCode, mod, stderr) // nolint
return nil, fmt.Errorf("non-zero exit code %d finding if current module depends on %q, stderr:\n%s", exitCode, mod, stderr)
}
}
}
@@ -133,7 +134,7 @@ func (m *Migrator) findSourceFiles() ([]string, error) {
return nil, fmt.Errorf("finding source files: %w", err)
}
if exitCode != 0 {
return nil, fmt.Errorf("non-zero exit code %d finding source files, stderr:\n%s\n", exitCode, stderr) // nolint
return nil, fmt.Errorf("non-zero exit code %d finding source files, stderr:\n%s", exitCode, stderr)
}

var files []string