Go reports an error in VS Code: Main redeclared in this block
1. In VS Code, Go reports an error: Main redeclared in this block. The reason is that there are multiple main functions in the directory. as shown in Figure 1

2. Reorganize an exercise directory structure scheme of A Tour of Go to ensure that each exercise can run go run main.go independently, and there will be no Main Rededeclared error. I decided to use the filename as the directory name, and then the filename is unified as main
go-gin-learning/
├── .devcontainer/
│ └── devcontainer.json
├── .gitignore
├── readme.md
├── docker-compose.yml
├── go.mod
├── go.sum
├── main.go # Original GIN project entrance
└─ GO-TOUR/ # GO TOUR Exercise Catalog
├── hello/
│ └── main.go
├──imports/
│ └── main.go
└── packages/
└── main.go
3. No more errors: main redeclared in this block.