updated dependencies and golangci-lint to v2
This commit is contained in:
@@ -145,7 +145,7 @@ func (p *plugin) createCommand() *cobra.Command {
|
||||
|
||||
func (p *plugin) migrateCreateHandler(template string, args []string, interactive bool) (string, error) {
|
||||
if len(args) < 1 {
|
||||
return "", errors.New("Missing migration file name")
|
||||
return "", errors.New("missing migration file name")
|
||||
}
|
||||
|
||||
name := args[0]
|
||||
@@ -172,7 +172,7 @@ func (p *plugin) migrateCreateHandler(template string, args []string, interactiv
|
||||
template, templateErr = p.goBlankTemplate()
|
||||
}
|
||||
if templateErr != nil {
|
||||
return "", fmt.Errorf("Failed to resolve create template: %v\n", templateErr)
|
||||
return "", fmt.Errorf("failed to resolve create template: %v", templateErr)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ func (p *plugin) migrateCreateHandler(template string, args []string, interactiv
|
||||
|
||||
// save the migration file
|
||||
if err := os.WriteFile(resultFilePath, []byte(template), 0644); err != nil {
|
||||
return "", fmt.Errorf("Failed to save migration file %q: %v\n", resultFilePath, err)
|
||||
return "", fmt.Errorf("failed to save migration file %q: %v", resultFilePath, err)
|
||||
}
|
||||
|
||||
if interactive {
|
||||
@@ -199,7 +199,7 @@ func (p *plugin) migrateCollectionsHandler(args []string, interactive bool) (str
|
||||
|
||||
collections := []*core.Collection{}
|
||||
if err := p.app.CollectionQuery().OrderBy("created ASC").All(&collections); err != nil {
|
||||
return "", fmt.Errorf("Failed to fetch migrations list: %v\n", err)
|
||||
return "", fmt.Errorf("failed to fetch migrations list: %v", err)
|
||||
}
|
||||
|
||||
var template string
|
||||
@@ -210,7 +210,7 @@ func (p *plugin) migrateCollectionsHandler(args []string, interactive bool) (str
|
||||
template, templateErr = p.goSnapshotTemplate(collections)
|
||||
}
|
||||
if templateErr != nil {
|
||||
return "", fmt.Errorf("Failed to resolve template: %v\n", templateErr)
|
||||
return "", fmt.Errorf("failed to resolve template: %v", templateErr)
|
||||
}
|
||||
|
||||
return p.migrateCreateHandler(template, createArgs, interactive)
|
||||
|
||||
Reference in New Issue
Block a user