Protocol buffers are a flexible and efficient way to represent structured data.
- Binary Serialzation
- Schema vs Schemaless
- Parse time
- Backwards compatibility
- Cross language/platform
package main | |
import ( | |
"log" | |
"math/rand" | |
"net/http" | |
_ "net/http/pprof" | |
"os" | |
"os/signal" | |
"runtime/debug" |
package main | |
import ( | |
"math/rand" | |
"sort" | |
"testing" | |
) | |
func benchSort(size int, b *testing.B) { | |
b.StopTimer() |
#!/bin/bash | |
set -e | |
tile=pivotal-container-service-0.7.1-build.6.pivotal | |
om_username=some-username | |
om_password=some-password | |
om_target=https://1.2.3.4 | |
mkdir -p $HOME/tile-dl | |
cd $HOME/tile-dl |
package main | |
import ( | |
"log" | |
"net" | |
) | |
func main() { | |
println("dialing") | |
conn, err := net.Dial("tcp", "localhost:12345") |
package main | |
import ( | |
"bytes" | |
"compress/gzip" | |
"io/ioutil" | |
"log" | |
"github.com/davecgh/go-spew/spew" | |
"github.com/golang/protobuf/proto" |
FROM golang:1.12 as builder | |
WORKDIR /root | |
ENV GOOS=linux \ | |
GOARCH=amd64 \ | |
CGO_ENABLED=0 | |
COPY /go.mod /go.sum /root/ |
Go is an imperative, compiled, statically-typed, garbage-collected, concurrent, general purpose programming language. It emphasizes fast compilation, fast execution, and a conservative, simple language design.
Go has modern, native implementations of many networking protocols.
type ExportedType struct { | |
unguarded int | |
// iternal state that is subject to concurrent access and requires locking | |
protected struct { | |
sync.RWMutex | |
guarded1 int | |
guarded2 int | |
guarded3 int | |
} |