You cannot have multiple packages (in your case main and goprorename) in one folder. This has nothing to do with modules. You must but these three files into two different folders based on their package declaration.
You might want to work through https://go.dev/doc/code V. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/06762e81-1316-4bbd-8e47-e5a35d0c16d9n%40googlegroups.com.