Skip to content

Instantly share code, notes, and snippets.

View crawshaw's full-sized avatar

David Crawshaw crawshaw

View GitHub Profile
package webfetch
import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
@crawshaw
crawshaw / webfetch.go
Created September 23, 2018 13:08
Caching http client wrapper with shutdown. Is shutdown logic worth it?
package webfetch
import (
"context"
"io"
"net/http"
"runtime"
"sync"
"time"
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: addressbook.proto
#ifndef PROTOBUF_addressbook_2eproto__INCLUDED
#define PROTOBUF_addressbook_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: addressbook.proto
#include "addressbook.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
@crawshaw
crawshaw / keybase.md
Last active June 8, 2018 10:30
Keybase proof

Keybase proof

I hereby claim:

  • I am crawshaw on github.
  • I am crawshaw (https://keybase.io/crawshaw) on keybase.
  • I have a public key ASD1fsP6-erG8NF7CFa_HPsYgeOQaVHpBN9JWswMS32K3Ao

To claim this, I am signing this object: