I am getting this error in golang 1.17.3: main.go:4:2: found packages routes (routes.go) and main (controller.go) in /home/developer/go/src/testapp
I am creating two different packages in same directory, i get this error but when i move them to different folders code works fine. Is there any change in go’s new version becuase it works fine on my another pc.
You can have multiple files in the same directory, but they need to have the same package name (they could both have package routes or they could both have package main, etc., but you cannot mix package names in the same folder).