Change verb and use switch stmt

Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
This commit is contained in:
Sasha Melentyev 2023-01-21 15:44:32 +03:00 committed by Benjamin Wang
parent bfc361e2df
commit 63902fafbd
2 changed files with 3 additions and 5 deletions

View File

@ -303,7 +303,7 @@ func (cfg *config) parse(arguments []string) error {
os.Exit(2)
}
if len(cfg.cf.flagSet.Args()) != 0 {
return fmt.Errorf("'%s' is not a valid flag", cfg.cf.flagSet.Arg(0))
return fmt.Errorf("%q is not a valid flag", cfg.cf.flagSet.Arg(0))
}
if cfg.printVersion {

View File

@ -263,10 +263,8 @@ func checkSupportArch() {
}
// To add a new platform, check https://github.com/etcd-io/website/blob/main/content/en/docs/${VERSION}/op-guide/supported-platform.md.
// The ${VERSION} is the etcd version, e.g. v3.5, v3.6 etc.
if runtime.GOARCH == "amd64" ||
runtime.GOARCH == "arm64" ||
runtime.GOARCH == "ppc64le" ||
runtime.GOARCH == "s390x" {
switch runtime.GOARCH {
case "amd64", "arm64", "ppc64le", "s390x":
return
}
// unsupported arch only configured via environment variable