logoalt Hacker News

auxiliarymooseyesterday at 11:34 PM1 replyview on HN

Writing "append(s, ...)" instead of "s = append(s, ...)" results in a compiler error because it is an unused expression. I'm not sure how a newbie could make this mistake since that code doesn't compile.


Replies

masklinntoday at 5:35 AM

Indeed the usual error is

    b := append(a, …)