Skip to content

[V3] Analyzer extension for concept exercise: basic-slices #25

@tehsphinx

Description

@tehsphinx

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 or cap given
  • check for a for loop (no range, not recursive)

Function NumberRow

  • check instantiation of the slice. No make or new should be used but a nil slice created with var 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, only append

Function RemoveItem

  • all 4 checks of GetItem apply here as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions