Skip to content

Documentation [arrays] doesn't match example code #845

@rbellabre

Description

@rbellabre

Love the series, thanks for taking the time to make it.

In this refactor: https://github.com/quii/learn-go-with-tests/blob/main/arrays/v7/sum_test.go

...
	checkSums := func(t testing.TB, got, want []int) {
...

The expected parameter is the interface type, whereas all versions in the code repo use a pointer to type T:

... 
	checkSums := func(t *testing.T, got, want []int) {
...

Since interfaces aren't covered until the next chapter and the example code differs from the documentation, it wasn't clear if this was intentional or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions