1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-21 23:30: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 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 {
@ -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)}
}