It is easy to shit on append
in go. The syntax is ugly, it doesn't feel elegant like using .map
might. The value in append
, like many other things in go, comes down to simplicity by consistency. When your brain wants to add something to a slice, you immediately snap to append. Your brain as a go developer works exactly like ever other go developer and the result is almost any code that you read acting the same way when it comes to adding values to a slice. Simplicity in code comes in many forms.