What will go build do when passing different arguments?

Here is my file structure.

  src/ // package src
  res/ // package res
  main.go // package main

I have tried these commands, all worked,but i want to know about how do the command do and the difference?

go build myproject // the module path is “myproject”
go build myproject/src
go build
go build main.go

There’s a brief description here go command - cmd/go - Go Packages.

If you want all the details, then add -x after build and it will tell you everything it does.