[#1513] cli/storagegroup: Fix linter remarks

`staticcheck` linter scolds on potential nil-dereference since it
doesn't know `common.ExitOnErr` definitely exists. Explicit `return`
fixes linter's remark and prevents potential bugs.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-17 12:05:00 +03:00 committed by LeL
parent 13e74fce8a
commit d2d1694113

View file

@ -25,6 +25,7 @@ func readCID(cmd *cobra.Command, id *cid.ID) {
f := cmd.Flag(flag) f := cmd.Flag(flag)
if f == nil { if f == nil {
common.ExitOnErr(cmd, "", fmt.Errorf("missing container flag (%s)", flag)) common.ExitOnErr(cmd, "", fmt.Errorf("missing container flag (%s)", flag))
return
} }
err := id.DecodeString(f.Value.String()) err := id.DecodeString(f.Value.String())
@ -37,6 +38,7 @@ func readSGID(cmd *cobra.Command, id *oid.ID) {
f := cmd.Flag(flag) f := cmd.Flag(flag)
if f == nil { if f == nil {
common.ExitOnErr(cmd, "", fmt.Errorf("missing storage group flag (%s)", flag)) common.ExitOnErr(cmd, "", fmt.Errorf("missing storage group flag (%s)", flag))
return
} }
err := id.DecodeString(f.Value.String()) err := id.DecodeString(f.Value.String())