Skip to content

Commit

Permalink
golint testing
Browse files Browse the repository at this point in the history
  • Loading branch information
astaxie committed Sep 12, 2015
1 parent a289b08 commit be7accc
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions testing/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
)

var port = ""
var baseUrl = "http://localhost:"
var baseURL = "http://localhost:"

// beego test request client
type TestHttpRequest struct {
httplib.BeegoHttpRequest
// TestHTTPRequest beego test request client
type TestHTTPRequest struct {
httplib.BeegoHTTPRequest
}

func getPort() string {
Expand All @@ -39,27 +39,27 @@ func getPort() string {
return port
}

// returns test client in GET method
func Get(path string) *TestHttpRequest {
return &TestHttpRequest{*httplib.Get(baseUrl + getPort() + path)}
// Get returns test client in GET method
func Get(path string) *TestHTTPRequest {
return &TestHTTPRequest{*httplib.Get(baseURL + getPort() + path)}
}

// returns test client in POST method
func Post(path string) *TestHttpRequest {
return &TestHttpRequest{*httplib.Post(baseUrl + getPort() + path)}
// Post returns test client in POST method
func Post(path string) *TestHTTPRequest {
return &TestHTTPRequest{*httplib.Post(baseURL + getPort() + path)}
}

// returns test client in PUT method
func Put(path string) *TestHttpRequest {
return &TestHttpRequest{*httplib.Put(baseUrl + getPort() + path)}
// Put returns test client in PUT method
func Put(path string) *TestHTTPRequest {
return &TestHTTPRequest{*httplib.Put(baseURL + getPort() + path)}
}

// returns test client in DELETE method
func Delete(path string) *TestHttpRequest {
return &TestHttpRequest{*httplib.Delete(baseUrl + getPort() + path)}
// Delete returns test client in DELETE method
func Delete(path string) *TestHTTPRequest {
return &TestHTTPRequest{*httplib.Delete(baseURL + getPort() + path)}
}

// returns test client in HEAD method
func Head(path string) *TestHttpRequest {
return &TestHttpRequest{*httplib.Head(baseUrl + getPort() + path)}
// Head returns test client in HEAD method
func Head(path string) *TestHTTPRequest {
return &TestHTTPRequest{*httplib.Head(baseURL + getPort() + path)}
}

0 comments on commit be7accc

Please sign in to comment.