9 "github.com/anacrolix/missinggo"
12 type StatusWriter interface {
13 WriteStatus(io.Writer)
16 // The key is the route pattern. The value is nil when the resource is
20 sws = map[string]StatusWriter{}
23 func ExportStatusWriter(sw StatusWriter, path string) (release func()) {
24 pattern := fmt.Sprintf("/%s/%s", missinggo.GetTestName(), path)
32 if curSw, ok := sws[pattern]; ok {
34 panic(fmt.Sprintf("%q still in use", pattern))
41 func(w http.ResponseWriter, r *http.Request) {