Declaring global variables that are not used does not report errors
# 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);
}
Correct writing style:
package main
import “fmt”
func main(){
// var a string=”hhh”;
var b,c int =1,2
fmt.Println(b,c);
}
# 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);
}
Correct writing style:
package main
import “fmt”
func main(){
// var a string=”hhh”;
var b,c int =1,2
fmt.Println(b,c);
}
Read More:
- [Solved] .\main.go:3:6: missing function body .\main.go:4:1: syntax error: unexpected semicolon or newline be
- GO Exception Runnerw.exe: CreateProcess failed with error 21
- Function declare Error: Error C231: ‘delay300us’: redefinition
- [Solved] Go language gob serialization pointer cannot be addressed Error
- [Solved] Error: The superclass, ‘Animal‘, has no unnamed constructor that takes no arguments.
- [Go] Testing when solving go test: warning: no tests to run
- [Solved] VScode Error: build constraints exclude all Go files in syscall\js
- Eslint error “no undef” and eslint rule configuration in Vue cli3
- [Solved] NDK JNI DETECTED ERROR IN APPLICATION: use of deleted local reference
- css-rcurlyexpected Error: css-rcurlyexpected at-rule, or selector expected, Do not use empty rulesets
- [How to Solve] Easyclick read text garbled
- The method println(boolean) in the type PrintStream is not applicable for the arguments (void) Error
- [Go] Solve the garbled content sent by go-smtp and the unparsed html mail sent
- How to Solve Import antd Error: Module build failed
- How to Solve Node GYP Rebuild Error
- [Solved] Docker Error: SyntaxError: Non-ASCII character ‘\xe5‘ in file xxx
- [Solved] Golang Error: fatal error: concurrent map writes
- [Solved] IDEA JSP File out.println Error: Cannot resolve method ‘println(java.lang.String)’
- [Solved] UE4 Error: Serial loading Unknown structure
- [Solved] Vue Error: Failed to mount component: template or render function not defined