1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-07 15:10:54 +02:00
echo/.github/ISSUE_TEMPLATE.md

34 lines
546 B
Markdown
Raw Normal View History

2017-06-14 21:15:04 -07:00
### Issue Description
2016-06-04 16:42:29 -07:00
### Working code to debug
2016-06-04 16:42:29 -07:00
```go
package main
2016-06-04 16:42:29 -07:00
import (
"github.com/labstack/echo/v4"
"net/http"
"net/http/httptest"
"testing"
)
2016-06-04 16:42:29 -07:00
func TestExample(t *testing.T) {
e := echo.New()
2016-06-04 16:42:29 -07:00
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
})
2016-06-04 16:42:29 -07:00
req := httptest.NewRequest(http.MethodGet, "/", nil)
rec := httptest.NewRecorder()
2016-06-04 16:42:29 -07:00
e.ServeHTTP(rec, req)
2016-06-04 16:42:29 -07:00
if rec.Code != http.StatusOK {
t.Errorf("got %d, want %d", rec.Code, http.StatusOK)
}
2016-06-04 16:42:29 -07:00
}
```
### Version/commit