Skip to content

Commit

Permalink
Fix linter error, fix #21
Browse files Browse the repository at this point in the history
  • Loading branch information
rg0now committed Sep 11, 2024
1 parent a770c93 commit 4af409c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions 19-structs/01-basics/.README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ In this exercise, you'll build a game store along with a set of functions to que
| {{index . "list" 1 "id"}} | {{index . "list" 1 "name"}} | {{index . "list" 1 "price"}} | {{index . "list" 1 "genre"}} |
| {{index . "list" 2 "id"}} | {{index . "list" 2 "name"}} | {{index . "list" 2 "price"}} | {{index . "list" 2 "genre"}} |

5. Write a `queryById` function that returns the game in a gamelist with the given id or an "No
such game" error.
5. Write a `queryById` function that returns the game in a gamelist with the given id or an "no such game" error.

6. Write a `listNameByPrice` function that returns the name of the game(s) with price equal or
smaller than a given price.
Expand Down
2 changes: 1 addition & 1 deletion 19-structs/01-basics/.exercise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestById(t *testing.T) {
assert.Equal(t, "{{index . "by_id" "result" "genre"}}", g.genre, "game genre")

g, err = queryById(newGameList(), 11)
assert.EqualError(t, err, "No such game", "error")
assert.EqualError(t, err, "no such game", "error")
}

func TestNameByPrice(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion 19-structs/01-basics/exercise.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func newGameList() []game {
// INSERT YOUR CODE HERE
}

// queryById returns the game in the specified store with the given id or returns a "No such game" error.
// queryById returns the game in the specified store with the given id or returns a "no such game" error.
func queryById(games []game, id int) (game, error) {
// INSERT YOUR CODE HERE
}
Expand Down

0 comments on commit 4af409c

Please sign in to comment.