This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"net/rpc" | |
"net/url" | |
"strconv" | |
"testing" |
This file contains hidden or 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
# uname -m | |
armv7l |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
This file contains hidden or 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
MacBook Pro (Retina, Mid 2012) | |
$ go version | |
go version go1.4.1 darwin/amd64 | |
$ go test -bench . | |
testing: warning: no tests to run | |
PASS | |
BenchmarkTimeAfter 2000000000 1.10 ns/op | |
BenchmarkTimeBefore 2000000000 1.07 ns/op | |
BenchmarkTimeUnixAfter 2000000000 1.22 ns/op |
This file contains hidden or 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
package main | |
import ( | |
"testing" | |
"time" | |
) | |
var old, now time.Time | |
func init() { |
This file contains hidden or 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 version | |
go version go1.4.1 darwin/amd64 | |
$ go test -bench . | |
testing: warning: no tests to run | |
PASS | |
BenchmarkIntsCallbackIterator 500 2733180 ns/op | |
BenchmarkDataCallbackIterator 500 3142514 ns/op | |
BenchmarkIntsChannelIterator 5 269527633 ns/op | |
BenchmarkDataChannelIterator 5 266374326 ns/op | |
BenchmarkIntsBufferedChannelIterator 20 94554939 ns/op |
This file contains hidden or 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
var res *s3.PutObjectOutput | |
err = backoff.Retry(func() error { | |
res, err = S3.PutObject(&req) | |
return err | |
}, backoff.NewExponentialBackOff()) | |
if err != nil { | |
log.Printf("err:%s", res, err) | |
} |
This file contains hidden or 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
var ( | |
accessKey = "AWSaccesskey" | |
secretKey = "AWSsecretKey" | |
region = "ap-northeast-1" | |
) | |
func main() { | |
httpClient := &http.Client{Timeout: time.Duration(30) * time.Second} | |
creds := aws.Creds(accessKey, secretKey, "") |
This file contains hidden or 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
$ cd $(go env GOROOT) # go をインストールしたディレクトリに移動 | |
$ cd src # その下の src | |
$ GOOS=windows GOARCH=amd64 ./make.bash |
This file contains hidden or 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 filter-branch -f --tree-filter "find . -name key.yml -exec sed -i -e 's/PasswordPassword1234/hoge/g' {} \;" --prune-empty -- --all |