Go語言在代碼規范中定義未使用的變量會報“declared and not used”錯誤
package main
import "fmt"
func main() {
var a, b, c int64
a = 10
b = 15
c = a + b
fmt.Printf("a = %d,b = %d",a ,b)
//fmt.Printf("c = %d",c)
}
這時候會報錯變量c定義未使用
.\test.go:9:6: c declared and not used