Eclipse选中变量名,相同变量都变色显示 java文件的设置"Window"-"preferences"-"Java"-"Editor"-"Mark Occurrences"复选框勾选Mark occurrences of the selected element in the cruuent file.
package main import ( "fmt" "math") func main() { // 1. 定义变量名age,不初始化,使用对应类型的默认值 var age int fmt.Println("My age is", age) // 2. 给变量赋值 age = 29 fmt.Println("My age is", age) age = 50 fmt.Println("My age is"