40 Files []string
41}
42
43func (c routerCtx) GetImages(w http.ResponseWriter, r *http.Request) { 44 w.Header().Set("Content-Type", "application/json")
45 dir, err := embedFS.ReadDir("images")
46 if err != nil {
59 json.NewEncoder(w).Encode(ls)
60}
61
62func (c routerCtx) OriginalImage(w http.ResponseWriter, r *http.Request) { 63 vars := mux.Vars(r)
64 img := vars["image"]
65 b, err := embedFS.ReadFile(path.Join("images", img))
9
10type mockHandler struct{}
11
12func (m mockHandler) ServeHTTP(http.ResponseWriter, *http.Request) {}13
14func TestNewServer(t *testing.T) {
15 var addr = "127.0.0.1:8080"
Methods with unused receivers can be a symptom of unfinished refactoring or a bug. To keep the same method signature, omit the receiver name or '_' as it is unused.
func (f *Unix) Name() string {
return "unix"
}
func (_ *Unix) Name() string {
return "unix"
}
func (*Unix) Name() string {
return "unix"
}