mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-06 04:34:37 +08:00
gofmt -s; fix misspellings and lint; Go 1.5.3 in Travis CI
This commit is contained in:
@ -138,7 +138,7 @@ func (r Rule) parseAddress() (string, string) {
|
||||
if strings.HasPrefix(r.Address, "tcp://") {
|
||||
return "tcp", r.Address[len("tcp://"):]
|
||||
}
|
||||
// check if address has fastcgi scheme explicity set
|
||||
// check if address has fastcgi scheme explicitly set
|
||||
if strings.HasPrefix(r.Address, "fastcgi://") {
|
||||
return "tcp", r.Address[len("fastcgi://"):]
|
||||
}
|
||||
|
@ -35,20 +35,20 @@ func TestRuleParseAddress(t *testing.T) {
|
||||
func TestBuildEnv(t *testing.T) {
|
||||
|
||||
buildEnvSingle := func(r *http.Request, rule Rule, fpath string, envExpected map[string]string, t *testing.T) {
|
||||
|
||||
|
||||
h := Handler{}
|
||||
|
||||
|
||||
env, err := h.buildEnv(r, rule, fpath)
|
||||
if err != nil {
|
||||
t.Error("Unexpected error:", err.Error())
|
||||
}
|
||||
|
||||
|
||||
for k, v := range envExpected {
|
||||
if env[k] != v {
|
||||
t.Errorf("Unexpected %v. Got %v, expected %v", k, env[k], v)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
rule := Rule{}
|
||||
|
@ -39,9 +39,7 @@ const (
|
||||
ipPort = "127.0.0.1:59000"
|
||||
)
|
||||
|
||||
var (
|
||||
t_ *testing.T
|
||||
)
|
||||
var globalt *testing.T
|
||||
|
||||
type FastCGIServer struct{}
|
||||
|
||||
@ -158,7 +156,7 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
if bytes.Index(content, []byte("FAILED")) >= 0 {
|
||||
t_.Error("Server return failed message")
|
||||
globalt.Error("Server return failed message")
|
||||
}
|
||||
|
||||
return
|
||||
@ -193,7 +191,7 @@ func generateRandFile(size int) (p string, m string) {
|
||||
|
||||
func DisabledTest(t *testing.T) {
|
||||
// TODO: test chunked reader
|
||||
t_ = t
|
||||
globalt = t
|
||||
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
|
Reference in New Issue
Block a user