Skip to content

Instantly share code, notes, and snippets.

type FailingStorage struct{}
func (f *FailingStorage) Add(k, v string) (err error) {
return errors.New("now we fail")
}
var s = NewSafeStorage(&FailingStorage{})
type FailingStorage struct{}
func (f *FailingStorage) Add(k, v string) {
throw exception.New("now we fail")
}
var s = NewSafeStorage(&FailingStorage{})
func handleAdd(w http.ResponseWriter, r *http.Request) {
key := r.Host
value := r.Method
package main
import (
"encoding/csv"
"flag"
"log"
"math/rand"
"os"
"strconv"
"time"