mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Compare strings using strings.EqualFold() (#8193)
This commit is contained in:
@@ -29,7 +29,7 @@ func restore(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not validate choice")
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
logrus.Info("Restore aborted")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func VerifyTosAcceptedOrPrompt(ctx *cli.Context) error {
|
||||
if err != nil {
|
||||
return errors.New(acceptTosPromptErrText)
|
||||
}
|
||||
if strings.ToLower(input) != "accept" {
|
||||
if !strings.EqualFold(input, "accept") {
|
||||
return errors.New("you have to accept Terms and Conditions in order to continue")
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func restore(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not validate choice")
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
logrus.Info("Restore aborted")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func DeleteAccountCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
@@ -80,7 +80,7 @@ func DeleteAccountCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ func DisableAccountsCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
@@ -76,7 +76,7 @@ func DisableAccountsCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func EnableAccountsCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
@@ -159,7 +159,7 @@ func EnableAccountsCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func interact(cliCtx *cli.Context, r io.Reader, validatingPublicKeys [][48]byte)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil, nil, nil
|
||||
}
|
||||
} else {
|
||||
@@ -142,7 +142,7 @@ func interact(cliCtx *cli.Context, r io.Reader, validatingPublicKeys [][48]byte)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil, nil, nil
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ func interact(cliCtx *cli.Context, r io.Reader, validatingPublicKeys [][48]byte)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ func extractWalletCreationConfigFromCli(cliCtx *cli.Context, keymanagerKind keym
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not validate choice")
|
||||
}
|
||||
if strings.ToLower(resp) == "y" {
|
||||
if strings.EqualFold(resp, "y") {
|
||||
mnemonicPassphrase, err := promptutil.InputPassword(
|
||||
cliCtx,
|
||||
flags.Mnemonic25thWordFileFlag,
|
||||
|
||||
@@ -58,7 +58,7 @@ func RecoverWalletCli(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not validate choice")
|
||||
}
|
||||
if strings.ToLower(resp) == "y" {
|
||||
if strings.EqualFold(resp, "y") {
|
||||
mnemonicPassphrase, err := promptutil.InputPassword(
|
||||
cliCtx,
|
||||
flags.Mnemonic25thWordFileFlag,
|
||||
|
||||
@@ -28,7 +28,7 @@ func restore(cliCtx *cli.Context) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not validate choice")
|
||||
}
|
||||
if strings.ToLower(resp) == "n" {
|
||||
if strings.EqualFold(resp, "n") {
|
||||
logrus.Info("Restore aborted")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user