go 03-unused-variables

2026-08-30 浏览 (1)

What happens when you don't use a declared variable in the block scope?

  • Nothing, it will work fine
  • It will get removed automatically
  • The program won't compile CORRECT

What happens when you don't use a declared variable in the package scope?

  • Nothing, it will work fine CORRECT
  • It will get removed automatically
  • The program won't compile

How can you prevent unused variable error?

  • You can change the variable's name
  • You can use a blank-identifier to discard it CORRECT
  • You can change the variable's type

你可能感兴趣的文章

go main

go main

go main

go main

go main

go Header

go main

go main

go main

go main

  • 所属分类: 后端技术
  • 本文标签: golang
  • 版权声明: 本文链接 https://seaxiang.com/blog/GZMQsQ7q