This is a created article in which the information may have evolved or changed.
Http://godoc.golangtc.com/doc/faq#inc_dec
Simply put, the,--operation in Golang + + is a statement instead of an expression. So a=b++, return x + + and the like absolute hint error. Statement is a place that cannot be placed in an expression
Why is and statements and not ++ -- expressions? And why postfix, not prefix?
Without pointer arithmetic, the convenience value of pre-and postfix increment operators drops. By removing them from the expression hierarchy altogether, expression syntax is simplified and the messy issues around Ord Er of evaluation of ++ and -- (consider and) is eliminated as well f(i++) p[i] = q[++i] . The simplification is significant. As for Postfix vs. prefix, either would work fine but the postfix version was more traditional; Insistence on prefix arose with the STL, a library for a language whose name contains, ironically, a postfix increment.