Skip to content

Instantly share code, notes, and snippets.

View jdoliner's full-sized avatar
💭
🐘

Joe Doliner jdoliner

💭
🐘
View GitHub Profile
func NewReadCloser(r io.Reader) ReadCloser {
if rc, ok := r.(io.ReadCloser) {
return ReadCloser{rc}
} else {
return NopReadCloser{r}
}
}
package main
import (
"fmt"
"reflect"
)
// Option types
type option interface {
char * lines[] = {
"Now is the winter of our discontent",
"Made glorious summer by this sun of York;",
"And all the clouds that lour'd upon our house",
"In the deep bosom of the ocean buried."
};
@jdoliner
jdoliner / oxford.c
Last active June 23, 2016 04:56
oxford
char * lines[] = {
"Now is the winter of our discontent",
"Made glorious summer by this sun of York;",
"And all the clouds that lour'd upon our house",
"In the deep bosom of the ocean buried.",
};
Repo[SalesUS] Repo[SalesEurope]
| |
| |
\ V
-------------->+ Pipeline[Filter]
|
|
Repo[FilterOutput] Repo[PopulationSizesPerGeography]
| |
V /
I1030 21:46:51.476931 1 plugins.go:69] No cloud provider specified.
I1030 21:46:51.477196 1 nodecontroller.go:114] Sending events to api server.
E1030 21:46:51.477299 1 controllermanager.go:201] Failed to start service controller: ServiceController should not be run without a cloudprovider.
I1030 21:46:51.477359 1 plugins.go:180] Loaded volume plugin "kubernetes.io/host-path"
I1030 21:46:51.477376 1 plugins.go:180] Loaded volume plugin "kubernetes.io/nfs"
E1030 21:46:51.477504 1 reflector.go:136] Failed to list *api.Pod: Get http://127.0.0.1:8080/api/v1/pods: dial tcp 127.0.0.1:8080: connection refused
E1030 21:46:51.477597 1 reflector.go:136] Failed to list *api.PersistentVolume: Get http://127.0.0.1:8080/api/v1/persistentvolumes: dial tcp 127.0.0.1:8080: connection refused
E1030 21:46:51.477571 1 reflector.go:136] Failed to list *api.Service: Get http://127.0.0.1:8080/api/v1/services: dial tcp 127.0.0.1:8080: connection refused
E1030 21:46:51.477605 1 re
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "etcd-rc-70dr3",
func Mount() {
mounter := ...
errChan := make(chan error)
go func() {
if err := mounter.Mount(); err != nil {
errChan <- err
}
}()
readyChan := make(chan bool)
go func() {
func enumerateFiles(dirname string, cb func (string) error ) {
filepath.Walk(dirname, func(path string, f os.FileInfo, err error) error {
if !f.IsDir() {
if err := cb(path); err != nil {
return err
}
}
return nil
})
}
for file := range enumerateFiles() {
...
break
...
}