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

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-01
  • 2021-09-10
  • 2022-12-23
  • 2021-11-02
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案