quii / learn-go-with-tests

Learn Go with test-driven development
MIT License
22.21k stars 2.81k forks source link

Update arrays-and-slices.md #774

Closed sabyasachi-mukherjee closed 4 months ago

sabyasachi-mukherjee commented 5 months ago

to call upon the function Sum from package sum, do we not need sum.Sum(numbers) instead of Sum(numbers)? Thanks!

quii commented 4 months ago

This really depends on what package your tests are in

If your test does

package sum

Then no, you don't need to do that

If your test does

package sum_test

Then, yes you will. At this point in the book we have not covered external test packages though, so I'll have to say no to this change. Thanks anyway :)