Home >Backend Development >Golang >The difference between '=' and ':=' in golang
In golang, "=" means assignment, and ":=" means declaring variables and assigning values.
For example:
// = 使用必须使用先var声明例如: var a a=100 //或 var b = 100 //或 var c int = 100
For example:
// := 是声明并赋值,并且系统自动推断类型,不需要var关键字 d := 100
Recommended related articles and tutorials: golang tutorial
The above is the detailed content of The difference between '=' and ':=' in golang. For more information, please follow other related articles on the PHP Chinese website!