Difference between := and = operators in Go

前端 未结 9 1406
野趣味
野趣味 2020-12-12 10:45

What is the difference between the = and := operators, and what are the use cases for them? They both seem to be for an assignment?

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 11:17

    The := means declare and assign while the = means to simply assign.

提交回复
热议问题