Closed rookiefromgis closed 2 years ago
1. create a new file user.go to represents the client:
2.Changes in the server.go:
.\server.go:16:24: undefined: User .\server.go:28:31: undefined: User .\server.go:50:37: undefined: User .\server.go:60:10: undefined: NewUser
The reason for the error belongs to the multi-file loading problem in Golang. When executing the go run command, we need to include all the .go files to be loaded into the parameters.
Basic server construction consists of main.go and server.go. The server contains server-type structure data and three methods: creating a server object, starting the server service, and processing the connection business.