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

chore: use errors.New to replace fmt.Errorf with no parameters #8675

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions go/cmd/dolt/dolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func runMain() int {
case featureVersionFlag:
var err error
if len(args) == 0 {
err = fmt.Errorf("missing argument for the --feature-version flag")
err = errors.New("missing argument for the --feature-version flag")
} else {
if featureVersion, err := strconv.Atoi(args[1]); err == nil {
doltdb.DoltFeatureVersion = doltdb.FeatureVersion(featureVersion)
Expand Down Expand Up @@ -742,12 +742,12 @@ If you're interested in running this command against a remote host, hit us up on

if noValidRepository && isValidRepositoryRequired {
return func(ctx context.Context) (cli.Queryist, *sql.Context, func(), error) {
err := fmt.Errorf("The current directory is not a valid dolt repository.")
err := errors.New("The current directory is not a valid dolt repository.")
if errors.Is(rootEnv.DBLoadError, nbs.ErrUnsupportedTableFileFormat) {
// This is fairly targeted and specific to allow for better error messaging. We should consider
// breaking this out into its own function if we add more conditions.

err = fmt.Errorf("The data in this database is in an unsupported format. Please upgrade to the latest version of Dolt.")
err = errors.New("The data in this database is in an unsupported format. Please upgrade to the latest version of Dolt.")
}

return nil, nil, nil, err
Expand Down Expand Up @@ -894,7 +894,7 @@ func parseGlobalArgsAndSubCommandName(globalConfig config.ReadWriteConfig, args
if err != nil {
if err == config.ErrConfigParamNotFound {
if hasProfile {
return nil, nil, "", fmt.Errorf("no profiles found")
return nil, nil, "", errors.New("no profiles found")
} else {
return apr, remaining, subcommandName, nil
}
Expand Down
Loading