#!/usr/bin/gorun package main func main() { println("Hello world!") }
$ chmod +x hello.go $ ./hello.go Hello world!
That's all. $ goinstall launchpad.net/gorun
$ sudo add-apt-repository ppa:gophers/go $ sudo apt-get update $ sudo apt-get install golang-stable # golang-weekly, golang-tip
$ time ./gorun hello.go Hello world! ./gorun hello.go 0.03s user 0.00s system 74% cpu 0.040 total $ time ./gorun hello.go Hello world! ./gorun hello.go 0.00s user 0.00s system 0% cpu 0.003 total
Source: https://habr.com/ru/post/137730/
All Articles