Edit: It's a documentation error
After some experiments, it looks that only quite old versions of Go understand go get -mod=, in particular version 1.11. So the documentation is outdated and you could report it.
Officially recommended on Go version 1.14 or newer: to automatically update an existing go.mod file and to download dependencies, instead of doing go get -mod=mod ., simply run:
go get -d .
For the sake of the example being complete, you could now actually build everything and put binaries into $GOBIN (or $GOPATH/bin) with:
go install
If it still doesn't work, a couple of things to check:
Update go to the latest version
The online documentation that you are reading is always about the latest official version, while you might be using an older version. Check your version:
go version
With the current pace of Go development, most people are trying to update as soon as they can. Follow https://golang.org/doc/install
Docs for the older version
Apparently, there is no easy way to read older documentation online. Instead, I use godoc tool to do it locally:
go get -v golang.org/x/tools/cmd/godoc
godoc -http=127.0.0.1:6060
Leave the above command running, then in your browser go to http://127.0.0.1:6060/cmd/go/
This way I've checked for example what the old docs said about -mod flag.