[#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>
experimental
Leonard Lyubich 2022-06-17 12:05:00 +03:00 committed by LeL
parent 13e74fce8a
commit d2d1694113
1 changed files with 2 additions and 0 deletions

View File

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