1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-18 16:20:53 +02:00
echo/.github/ISSUE_TEMPLATE.md

34 lines
546 B
Markdown
Raw Normal View History

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