go-by-test/context/context.go

17 lines
225 B
Go
Raw Normal View History

2024-09-21 18:07:09 +00:00
package context
import (
"fmt"
"net/http"
)
type Store interface {
Fetch() string
}
func Server(store Store) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, store.Fetch())
}
}