gofmt
develop
2016-07-06, Gary Kramlich
--- a/assets.go Tue Jun 28 15:14:39 2016 -0500
+++ b/assets.go Wed Jul 06 13:09:54 2016 -0500
@@ -83,7 +83,7 @@
- info := bindataFileInfo{name: "assets/schema.json", size: 6338, mode: os.FileMode(420), modTime: time.Unix(1447473136, 0)}
+ info := bindataFileInfo{name: "assets/schema.json", size: 6338, mode: os.FileMode(420), modTime: time.Unix(1448897734, 0)} a := &asset{bytes: bytes, info: info}
@@ -182,6 +182,7 @@
Func func() (*asset, error)
Children map[string]*bintree
var _bintree = &bintree{nil, map[string]*bintree{
"assets": &bintree{nil, map[string]*bintree{
"schema.json": &bintree{assetsSchemaJson, map[string]*bintree{}},
@@ -234,4 +235,3 @@
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
--- a/console_reporter.go Tue Jun 28 15:14:39 2016 -0500
+++ b/console_reporter.go Wed Jul 06 13:09:54 2016 -0500
@@ -10,7 +10,7 @@
type ConsoleReporter struct {
func (reporter *ConsoleReporter) Init(verbose bool) {
--- a/loader.go Tue Jun 28 15:14:39 2016 -0500
+++ b/loader.go Wed Jul 06 13:09:54 2016 -0500
@@ -12,8 +12,8 @@
- Name string `json:"name"`
- Request TestRequest `json:"request"`
+ Name string `json:"name"` + Request TestRequest `json:"request"` Requests []TestRequest `json:"requests"`
--- a/reporter.go Tue Jun 28 15:14:39 2016 -0500
+++ b/reporter.go Wed Jul 06 13:09:54 2016 -0500
@@ -12,7 +12,7 @@
type HandlerFunc func(handler ReportHandler)
@@ -25,48 +25,48 @@
-func (reporter *Reporter)report(function HandlerFunc) {
+func (reporter *Reporter) report(function HandlerFunc) { for _, handler := range reporter.handlers {
-func (reporter *Reporter)AddHandler(handler ReportHandler) {
+func (reporter *Reporter) AddHandler(handler ReportHandler) { handler.Init(reporter.verbose)
reporter.handlers = append(reporter.handlers, handler)
-func (reporter *Reporter)Start(tests int) {
+func (reporter *Reporter) Start(tests int) { reporter.report(func(handler ReportHandler) {
-func (reporter *Reporter)Finish(tests int, passed int, failed int) {
+func (reporter *Reporter) Finish(tests int, passed int, failed int) { reporter.report(func(handler ReportHandler) {
handler.Finish(tests, passed, failed)
-func (reporter *Reporter)TestStart(test Test) {
+func (reporter *Reporter) TestStart(test Test) { reporter.report(func(handler ReportHandler) {
-func (reporter *Reporter)TestFinish(test Test, res TestResult) {
+func (reporter *Reporter) TestFinish(test Test, res TestResult) { reporter.report(func(handler ReportHandler) {
handler.TestFinish(test, res)
-func (reporter *Reporter)LoadTestsFailed(err error) {
+func (reporter *Reporter) LoadTestsFailed(err error) { reporter.report(func(handler ReportHandler) {
handler.LoadTestsFailed(err)
-func (reporter *Reporter)LoadTestFailed(path string, err error) {
+func (reporter *Reporter) LoadTestFailed(path string, err error) { reporter.report(func(handler ReportHandler) {
handler.LoadTestFailed(path, err)
--- a/reporter_test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/reporter_test.go Wed Jul 06 13:09:54 2016 -0500
@@ -1,44 +1,44 @@
type MockHandler struct {
-func (m *MockHandler)Init(v bool) {
+func (m *MockHandler) Init(v bool) { -func (m *MockHandler)Start(t int) {
+func (m *MockHandler) Start(t int) { -func (m *MockHandler)Finish(t int, p int, f int) {
+func (m *MockHandler) Finish(t int, p int, f int) { -func (m *MockHandler)TestStart(t Test) {
+func (m *MockHandler) TestStart(t Test) { -func (m *MockHandler)TestFinish(t Test, r TestResult) {
+func (m *MockHandler) TestFinish(t Test, r TestResult) { -func (m *MockHandler)LoadTestsFailed(e error) {
+func (m *MockHandler) LoadTestsFailed(e error) { -func (m *MockHandler)LoadTestFailed(p string, e error) {
+func (m *MockHandler) LoadTestFailed(p string, e error) { @@ -47,7 +47,7 @@
t.Errorf("verbose flag was not honored")
--- a/runner.go Tue Jun 28 15:14:39 2016 -0500
+++ b/runner.go Wed Jul 06 13:09:54 2016 -0500
@@ -58,7 +58,7 @@
- reporter.Finish(n_tests, passed, n_tests - passed)
+ reporter.Finish(n_tests, passed, n_tests-passed) failed := n_tests - passed
--- a/test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test.go Wed Jul 06 13:09:54 2016 -0500
@@ -8,10 +8,10 @@
--- a/test_form_data.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_form_data.go Wed Jul 06 13:09:54 2016 -0500
@@ -1,7 +1,7 @@
type TestFormData struct {
- Value string `json:"value"`
- Json map[string]interface{} `json:"json"`
- Filename string `json:"filename"`
+ Value string `json:"value"` + Json map[string]interface{} `json:"json"` + Filename string `json:"filename"` --- a/test_form_data_test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_form_data_test.go Wed Jul 06 13:09:54 2016 -0500
@@ -8,15 +8,15 @@
func TestFormDataTagsTest(t *testing.T) {
- fields := map[string]string {
+ fields := map[string]string{ for g, j := range fields {
field, ok := reflect.TypeOf(fd).Elem().FieldByName(g)
t.Errorf("failed to find field %s", g)
--- a/test_request.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_request.go Wed Jul 06 13:09:54 2016 -0500
@@ -2,8 +2,8 @@
@@ -19,19 +19,19 @@
type TestRequest struct {
- Path string `json:"path"`
- Query map[string]string `json:"query"`
- Headers map[string]string `json:"headers"`
- Method string `json:"method"`
- Body string `json:"body"`
- FormData map[string]TestFormData `json:"form-data"`
- URLEncoded map[string]string `json:"x-www-form-urlencoded"`
- Binary string `json:"binary"`
- Json interface{} `json:"json"`
- Response TestResponse `json:"response"`
+ Path string `json:"path"` + Query map[string]string `json:"query"` + Headers map[string]string `json:"headers"` + Method string `json:"method"` + Body string `json:"body"` + FormData map[string]TestFormData `json:"form-data"` + URLEncoded map[string]string `json:"x-www-form-urlencoded"` + Binary string `json:"binary"` + Json interface{} `json:"json"` + Response TestResponse `json:"response"` -func (req *TestRequest)buildBody(test *Test) (io.Reader, string) {
+func (req *TestRequest) buildBody(test *Test) (io.Reader, string) { content_type := "application/html"
@@ -103,7 +103,7 @@
return body, content_type
-func (req *TestRequest)buildRequest(test *Test, url *url.URL) (*http.Request, error) {
+func (req *TestRequest) buildRequest(test *Test, url *url.URL) (*http.Request, error) { @@ -134,7 +134,7 @@
-func (req *TestRequest)compareResponse(res *TestResult, hresp *http.Response) {
+func (req *TestRequest) compareResponse(res *TestResult, hresp *http.Response) { res.HttpResponse = *hresp
// first check the resp code
--- a/test_request_test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_request_test.go Wed Jul 06 13:09:54 2016 -0500
@@ -11,22 +11,22 @@
func TestRequestTagsTest(t *testing.T) {
- fields := map[string]string {
- "FormData": "form-data",
+ fields := map[string]string{ + "FormData": "form-data", "URLEncoded": "x-www-form-urlencoded",
- "Response": "response",
+ "Response": "response", for g, j := range fields {
field, ok := reflect.TypeOf(fd).Elem().FieldByName(g)
t.Errorf("failed to find field %s", g)
@@ -68,12 +68,12 @@
func TestRequestBuildBodyJsonTest(t *testing.T) {
- j := map[string]interface{} {
+ j := map[string]interface{}{ - "baz": map[string] interface{} {
+ "baz": map[string]interface{}{ --- a/test_response.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_response.go Wed Jul 06 13:09:54 2016 -0500
@@ -1,9 +1,9 @@
type TestResponse struct {
- StatusCode int `json:"statuscode"`
- Headers map[string]string `json:"headers"`
- Body string `json:"body"`
+ StatusCode int `json:"statuscode"` + Headers map[string]string `json:"headers"` + Body string `json:"body"` JSONSchema map[string]interface{} `json:"json-schema"`
- File map[string]string `json:"file"`
+ File map[string]string `json:"file"` --- a/test_response_test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_response_test.go Wed Jul 06 13:09:54 2016 -0500
@@ -8,17 +8,17 @@
func TestResponseTagsTest(t *testing.T) {
- fields := map[string]string {
+ fields := map[string]string{ "StatusCode": "statuscode",
"JSONSchema": "json-schema",
for g, j := range fields {
field, ok := reflect.TypeOf(fd).Elem().FieldByName(g)
t.Errorf("failed to find field %s", g)
--- a/test_result.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_result.go Wed Jul 06 13:09:54 2016 -0500
@@ -1,12 +1,12 @@
HttpResponse http.Response
TestResponse TestResponse
--- a/test_result_test.go Tue Jun 28 15:14:39 2016 -0500
+++ b/test_result_test.go Wed Jul 06 13:09:54 2016 -0500
@@ -1,6 +1,6 @@