cp …; ./do; Or how go executables are awesome and portable

Today I finally got around to starting up the small webservices that usually run on my main desktop after a short interruption when my first generation SSD had started corrupting data and dropping inodes every time I powercycled the tower.

It took a while to get my OS (arch linux), environment, database (postgresql), message queue server (rabbitmq) and other sundries up and working. I eventually got around to moving my binary and development files over from my old drive. I started my systemd units and everything looked fine until I wanted to visualize the data that was coming in from the sensor I was harvesting.

$ go run srv.go

I typed, anticipating the visualization suite I’ve been poking at occasionally in a separate project than the harvesting code, which is as close to production as house-level neat code project get. to pop into existance and happily start serving stuff when the console spits back

zsh: command not found: go

Huh…

$ sudo pacman -S go
.
.
.
(1/1) installing go                                                    [########################################] 100%
$ go run srv.go
2015/06/11 01:16:40 [i] Server started
2015/06/11 01:16:40 [i] Serving on  :6864

And there you have it. Without any fussy evironment managers or global installation of packages, my go executables had just ran without go even being installed and the code that I did want to run just up and ran without complaint once go was installed.

I love go. Never change, you crazy, obstinate, wonderful language you.

 
0
Kudos
 
0
Kudos

Now read this

Caveman Reboot

Reposted from my OPW days WARNING: Do your research and make sure you know what you’re doing. The commands found in this article could seriously affect your machine and I print them here with no warranty. I am not responsible for your... Continue →