Skip to content

Commit

Permalink
use switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnN193 committed Apr 5, 2024
1 parent 9c18425 commit 4cac84c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions viam_cartographer.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,11 @@ func New(
}

subAlgo := SubAlgo(svcConfig.ConfigParams["mode"])
if subAlgo == "" {
switch subAlgo {
case "":
subAlgo = Dim2d
}
if subAlgo != Dim2d {
case Dim2d:
default:
return nil, errors.Errorf("%v does not have a 'mode: %v'",
c.Model.Name, svcConfig.ConfigParams["mode"])
}
Expand Down

0 comments on commit 4cac84c

Please sign in to comment.