[Solved] route method becomes undefined in main package file
There are two problems: #1 You need to have both files in the same directory with the same package name; namely, main. #2 You need to compile and execute all files in this directory which you can do either using: go run ./… to execute all files in this directory, or, go run app.go main.go … Read more