[#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:
parent
13e74fce8a
commit
d2d1694113
1 changed files with 2 additions and 0 deletions
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue