[바미] Go - RESTful API(DELETE)
·
프로그래밍(Web)/Golang
기존에 있는 코드에 이어서 테스트 코드 부터 만들어 줍니다. myapp/app_test.go package myapp import ( "encoding/json" "io/ioutil" "net/http" "net/http/httptest" "strconv" "strings" "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.S..