This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+build ignore | |
package main | |
import ( | |
"archive/tar" | |
"bytes" | |
"compress/gzip" | |
"io" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the lines below to your init.coffee file to automatically update the | |
# GOPATH used by tools like those from the go-plus plugin. | |
fs = require("fs") | |
path = require("path") | |
for p in atom.project.getPaths() | |
workspace = path.join(p, "Godeps", "_workspace") | |
if fs.existsSync(workspace) | |
process.env.GOPATH = workspace + ":" + process.env.GOPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go build sigkill.go | |
$ ./sigkill & | |
[1] 13969 | |
$ kill %1 | |
[1]+ Exit 2 ./sigkill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run panic.go | |
2016/04/01 21:51:12 start | |
2016/04/01 21:51:12 creating container "680b98d36ce2e667"... | |
^C2016/04/01 21:51:15 removing container "680b98d36ce2e667"... | |
2016/04/01 21:51:16 removed "680b98d36ce2e667" | |
2016/04/01 21:51:16 done | |
2016/04/01 21:51:16 run time panic: early termination | |
$ go run panic.go | |
2016/04/01 21:51:18 start | |
2016/04/01 21:51:18 creating container "7265daca397afe17"... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run signal.go | |
1/3 = 0 | |
1/2 = 0 | |
1/1 = 1 | |
hello from deferred call! | |
panic: runtime error: integer divide by zero | |
[signal 0x8 code=0x1 addr=0x400d3d pc=0x400d3d] | |
goroutine 1 [running]: | |
main.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run -race racy.go | |
================== | |
WARNING: DATA RACE | |
Write by goroutine 5: | |
main.func·001() | |
/tmp/racy.go:12 +0x158 | |
Previous read by main goroutine: | |
main.main() | |
/tmp/racy.go:15 +0xdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch upstream pull/8268/merge:pr8268 | |
git checkout pr8268 | |
godep go build -race ./cmd/oc | |
./oc rsync docs/ frontend-1-208zy:/ --watch > stdout.log 2> stderr.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ set -o errexit | |
+ rm -rf /tmp/gopath | |
+ mkdir -p /tmp/gopath/src/github.com/openshift /tmp/gopath/src/k8s.io | |
+ export GOPATH=/tmp/gopath | |
+ GOPATH=/tmp/gopath | |
+ cd /tmp/gopath/src/github.com/openshift | |
+ git clone https://github.com/openshift/origin | |
Cloning into 'origin'... | |
+ cd /tmp/gopath/src/k8s.io | |
+ git clone https://github.com/kubernetes/kubernetes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔ /tmp | |
10:31 $ go version | |
go version go1.6 linux/amd64 | |
✔ /tmp | |
10:31 $ go run deadlock.go | |
fatal error: all goroutines are asleep - deadlock! | |
goroutine 1 [chan receive]: | |
main.main() | |
/tmp/deadlock.go:12 +0x76 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go test -v -bench . strcmp_test.go | |
testing: warning: no tests to run | |
PASS | |
BenchmarkEmptyString 2000000000 0.78 ns/op | |
BenchmarkLen0 2000000000 0.94 ns/op | |
ok command-line-arguments 3.617s |