声明全局变量不使用不会报错
# command-line-arguments
.\main.go:4:6: a declared but not used
package main
import "fmt"
func main(){
var a string="hhh";
var b,c int =1,2
fmt.Println(b,c);
}
正确写法:
package main
import "fmt"
func main(){
// var a string="hhh";
var b,c int =1,2
fmt.Println(b,c);
}