From 60970baf201a743d4e3d8951ab0e40ccae991d48 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Fri, 28 Feb 2020 10:53:56 +0100 Subject: [PATCH] update from PR comments --- server/start.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/start.go b/server/start.go index 06b4f9b8f0..c5bee58e8f 100644 --- a/server/start.go +++ b/server/start.go @@ -34,8 +34,16 @@ const ( FlagUnsafeSkipUpgrades = "unsafe-skip-upgrades" ) -var errPruningWithGranularOptions = fmt.Errorf("%s flag is not compatible with granular options as %s or %s", flagPruning, flagPruningKeepEvery, flagPruningSnapshotEvery) -var errPruningGranularOptions = fmt.Errorf("%s and %s must be set together", flagPruningSnapshotEvery, flagPruningKeepEvery) +var ( + errPruningWithGranularOptions = fmt.Errorf( + "'--%s' flag is not compatible with granular options '--%s' or '--%s'", + flagPruning, flagPruningKeepEvery, flagPruningSnapshotEvery, + ) + errPruningGranularOptions = fmt.Errorf( + "'--%s' and '--%s' must be set together", + flagPruningSnapshotEvery, flagPruningKeepEvery, + ) +) // StartCmd runs the service passed in, either stand-alone or in-process with // Tendermint. @@ -104,7 +112,7 @@ which accepts a path for the resulting pprof file. // checkPruningParams checks that the provided pruning params are correct func checkPruningParams() error { if !viper.IsSet(flagPruning) && !viper.IsSet(flagPruningKeepEvery) && !viper.IsSet(flagPruningSnapshotEvery) { - return nil // Use default + return nil } if viper.IsSet(flagPruning) {