context: add basic context test
This commit is contained in:
16
context/context.go
Normal file
16
context/context.go
Normal file
@ -0,0 +1,16 @@
|
||||
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())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user