My project structure is like this.
packagetest/ main.go lib.go
In main.go, I have this code.
main.go
package m
Try running just go build. When you give it a go file as an argument, it will not look for other go files. You can also do go build *.go
go build
go build *.go