All of the following information is based on go version go1.8.3 darwin/amd64.
(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)
androiddarwin
| // First: go get github.com/golang/glog | |
| // Then : go test -v -vmodule=*=3 -logtostderr netgrace_test.go | |
| // This test package shows how to gracefully shutdown a net.Listener. | |
| package netgrace | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "github.com/golang/glog" |
| https://docs.docker.com/develop/sdk/examples/ |
| package auth | |
| import ( | |
| "net/http" | |
| "net/url" | |
| "strings" | |
| "time" | |
| "colobu.com/tr/common/data" | |
| "colobu.com/tr/common/db" |
| package components | |
| import "syscall" | |
| func setpriority() { | |
| syscall.Setpriority(syscall.PRIO_PGRP, 0, 9) | |
| } |
| ### IMPROVE SYSTEM MEMORY MANAGEMENT ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
| // This is a test where I was trying to isolate how much we lost to `reflect` | |
| // with channel operations in a tight loop. | |
| // | |
| // PREAMBLE | |
| // We do a lot of processing of stream data where ordering with respect to a | |
| // shard indicator like user ID matters. We've done this a few times where we | |
| // implement fanout based on hashing into an slice/array of channels, and it's | |
| // lightning fast but it ends up leaving a lot of boilerplate in your code. | |
| // | |
| // So I started writing a library that would do the non-critical boilerplate |
| #!/bin/bash -e | |
| protobuf_directories=$(find . -not -path ./.git/ -not -path ./.idea/ -type d -name "pb") | |
| googleapis_path=$(go list -m -f '{{.Dir}}' github.com/googleapis/googleapis) | |
| while read -r p; do | |
| echo "generating protobuf for $p" | |
| protoc -I. -I$googleapis_path --go_out=plugins=grpc:. $p/*.proto | |
| done <<< "$protobuf_directories" |