-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
This issue describes what the Go analyzer should check for in the card-tricks
exercise.
Function GetItem
- no
else
should be used - early return should be used which makes a total sum of 2 return statements.
- there needs to be exactly one
if
statement (with 2 conditions) - no
switch
should be used
Function SetItem
- all 4 checks of
GetItem
apply here as well
Function PrefilledSlice
- check instantiation of the slice. It should be created with a
len
orcap
given - check for a for loop (no
range
, not recursive)
Function NumberRow
- check instantiation of the slice. No
make
ornew
should be used but a nil slice created withvar xy []int
- optional: check if for loop increases index (
for i := 1; true; i++
)
Function RemoveItemPure
- all 4 checks of
GetItem
apply here as well - shouldn't use a
for
loop, onlyappend
Function RemoveItem
- all 4 checks of
GetItem
apply here as well
Metadata
Metadata
Assignees
Labels
No labels