Hacker News new | ask | show | jobs
by HL33tibCe7 1195 days ago
ChangeOil is an awful example. Your “better” code is untestable.

And ChangeOil(car, nil) makes complete sense to remove all the car’s oil: in Go, a nil slice is (essentially) equivalent to [].