# Snippets

```golang
type Envelope struct {
    Type string
    Msg  interface{}
}

var env Envelope
if err := json.Unmarshal([]byte(input), &env); err != nil {
        log.Fatal(err)
    }
// for the love of Gopher DO NOT DO THIS
var desc string = env.Msg.(map[string]interface{})["description"].(string)
fmt.Println(desc)
```

```shell
ls *.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'
```