[바미] Go - RESTful API(POST)
·
프로그래밍(Web)/Golang
GET에 이어서 myapp/app_test.go를 수정 해줍니다. myapp/app_test.go package myapp import ( "io/ioutil" "net/http" "net/http/httptest" "testing" "github.com/stretchr/testify/assert" ) func TestIndex(t *testing.T) { assert := assert.New(t) ts := httptest.NewServer(NewHandler()) defer ts.Close() resp, err := http.Get(ts.URL) assert.NoError(err) assert.Equal(http.StatusOK, resp.StatusCode) data, _ := ioutil.Read..