go: fix --HEAD build and use https for HEAD hg.

Closes #18030.
Closes #17913.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>