GOOS=linux GOARCH=arm GOARM=7 go build
See http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c... for cross compilation instructions.
Then I created a new user, scpd the distribution and added gogs binary to rc.local. I also installed git from the Synology package manager. There was some tweaking involved, but that was mostly it.