F5 go error: main redeclared in this block
The reason is that there cannot be more than one package main
under the same directory
Solution: create two folders hello and main respectively, put the files in them, and execute F5 again. There will be no problem.
Read More:
- [Solved] .\main.go:3:6: missing function body .\main.go:4:1: syntax error: unexpected semicolon or newline be
- [Solved] Golang Error: main.go:5:2: package go_code/chapter10/factory/model is not in GOROOT
- Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used
- [GO] The entry file under the main package in golang calls other go file functions and appears undefined
- Implement base64_decode in GO language to solve the problem of illegal characters
- [Solved] Go language gob serialization pointer cannot be addressed Error
- [Solved] ERROR A malformed block was encountered while loading a block
- [Solved] Error running ‘go build myfir_go_project‘: Cannot run program
- [Solved] cannot find package “go.opentelemetry.io/otel/api/trace“ in any of
- [Solved] VScode Error: build constraints exclude all Go files in syscall\js
- [Solved] AS Run main() Error: Could not create task ‘:app:CreateOperatorDemo.main()‘
- C Language error: two or more data types in declaration specifiers
- [Solved] Opencv error: assertion__acrt_first_block == header
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- [Solved] Sparksql error: Exception in thread “main” org.apache.spark.sql.catalyst.errors.package$TreeNodeException
- GO Exception Runnerw.exe: CreateProcess failed with error 21
- Gitlab Reconfigure is Stuck ruby_block[wait for redis service socket] action run
- [Solved] R Language Error: Error in file(out, “wt“) : cannot open the connection
- [Solved] go cobra Error: required flag(s) “pkg-name” not set
- How to Solve Docker Error: elasticsearch exception: type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];