> You could probably improve the above by using an interface rather than a bool to reduce the memory impact. If you need a function that preserves the order that might be a better implementation.
An empty interface occupies 16 bytes. Perhaps the author meant an empty struct which consumes nothing.