1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 05:10:55 +00:00

golint testing

This commit is contained in:
astaxie 2015-09-12 23:19:18 +08:00
parent a289b08e64
commit be7accc94c

View File

@ -20,11 +20,11 @@ import (
) )
var port = "" var port = ""
var baseUrl = "http://localhost:" var baseURL = "http://localhost:"
// beego test request client // TestHTTPRequest beego test request client
type TestHttpRequest struct { type TestHTTPRequest struct {
httplib.BeegoHttpRequest httplib.BeegoHTTPRequest
} }
func getPort() string { func getPort() string {
@ -39,27 +39,27 @@ func getPort() string {
return port return port
} }
// returns test client in GET method // Get returns test client in GET method
func Get(path string) *TestHttpRequest { func Get(path string) *TestHTTPRequest {
return &TestHttpRequest{*httplib.Get(baseUrl + getPort() + path)} return &TestHTTPRequest{*httplib.Get(baseURL + getPort() + path)}
} }
// returns test client in POST method // Post returns test client in POST method
func Post(path string) *TestHttpRequest { func Post(path string) *TestHTTPRequest {
return &TestHttpRequest{*httplib.Post(baseUrl + getPort() + path)} return &TestHTTPRequest{*httplib.Post(baseURL + getPort() + path)}
} }
// returns test client in PUT method // Put returns test client in PUT method
func Put(path string) *TestHttpRequest { func Put(path string) *TestHTTPRequest {
return &TestHttpRequest{*httplib.Put(baseUrl + getPort() + path)} return &TestHTTPRequest{*httplib.Put(baseURL + getPort() + path)}
} }
// returns test client in DELETE method // Delete returns test client in DELETE method
func Delete(path string) *TestHttpRequest { func Delete(path string) *TestHTTPRequest {
return &TestHttpRequest{*httplib.Delete(baseUrl + getPort() + path)} return &TestHTTPRequest{*httplib.Delete(baseURL + getPort() + path)}
} }
// returns test client in HEAD method // Head returns test client in HEAD method
func Head(path string) *TestHttpRequest { func Head(path string) *TestHTTPRequest {
return &TestHttpRequest{*httplib.Head(baseUrl + getPort() + path)} return &TestHTTPRequest{*httplib.Head(baseURL + getPort() + path)}
} }