The beats have a make package
target (See and packer tool). It's using xgo for cross compiling and fpm to build the actual deb/rpm packages.
The filebeat Makefile includes the Makefile providing packer
and sets some environment variables.
If you have a very custom main.go, this might be some overkill though. If all you need is a debian package you can also check out dh-make-golang.