Preparing report...

Report for github.com/qiniu/httptest

A+    Excellent!    Found 9 issues across 15 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo100%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

No problems detected. Good job!


golint40%

Golint is a linter for Go source code.

    • httptest/context.go
    • Line 12: warning: exported type TransportComposer should have comment or be unexported (golint)
    • Line 16: warning: exported type Executor should have comment or be unexported (golint)
    • Line 38: warning: exported type Request should have comment or be unexported (golint)
    • Line 48: warning: exported function NewRequest should have comment or be unexported (golint)
    • Line 62: warning: exported method Request.WithAuth should have comment or be unexported (golint)
    • Line 84: warning: exported method Request.WithHeader should have comment or be unexported (golint)
    • Line 90: warning: exported method Request.WithBody should have comment or be unexported (golint)
    • Line 97: warning: exported method Request.WithBodyf should have comment or be unexported (golint)
    • Line 143: warning: exported method Request.Ret should have comment or be unexported (golint)
    • Line 157: warning: exported type TestingT should have comment or be unexported (golint)
    • Line 162: warning: exported type NilTestingT should have comment or be unexported (golint)
    • Line 164: warning: exported method NilTestingT.Fatal should have comment or be unexported (golint)
    • Line 165: warning: exported method NilTestingT.Log should have comment or be unexported (golint)
    • Line 169: warning: exported type Context should have comment or be unexported (golint)
    • Line 179: warning: exported function New should have comment or be unexported (golint)
    • Line 194: warning: exported method Context.SetTransport should have comment or be unexported (golint)
    • Line 199: warning: exported method Context.SetAuth should have comment or be unexported (golint)
    • Line 204: warning: exported method Context.Exec should have comment or be unexported (golint)
    • Line 210: warning: exported method Context.Request should have comment or be unexported (golint)
    • Line 215: warning: exported method Context.Requestf should have comment or be unexported (golint)
    • httptest/exec/executor.go
    • Line 14: warning: exported type IContext should have comment or be unexported (golint)
    • Line 18: warning: exported type IExternalContext should have comment or be unexported (golint)
    • Line 23: warning: exported var External should have comment or be unexported (golint)
    • Line 29: warning: exported type Context should have comment or be unexported (golint)
    • Line 35: warning: exported function New should have comment or be unexported (golint)
    • Line 40: warning: exported method Context.Exec should have comment or be unexported (golint)
    • Line 56: warning: exported method Context.GetRawCmd should have comment or be unexported (golint)
    • httptest/var.go
    • Line 12: warning: should not use dot imports (golint)
    • Line 16: warning: don't use underscores in Go names; const Fmttype_Json should be FmttypeJSON (golint)
    • Line 16: warning: exported const Fmttype_Json should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: don't use underscores in Go names; const Fmttype_Form should be FmttypeForm (golint)
    • Line 18: warning: don't use underscores in Go names; const Fmttype_Text should be FmttypeText (golint)
    • Line 19: warning: don't use underscores in Go names; const Fmttype_Jsonstr should be FmttypeJsonstr (golint)
    • Line 24: warning: exported function PrettyPrintln should have comment or be unexported (golint)
    • Line 41: warning: exported function Fprintln should have comment or be unexported (golint)
    • Line 49: warning: exported function Println should have comment or be unexported (golint)
    • Line 67: warning: exported method Context.GetVar should have comment or be unexported (golint)
    • Line 73: warning: exported method Context.Requestv should have comment or be unexported (golint)
    • Line 84: warning: exported method Request.WithHeaderv should have comment or be unexported (golint)
    • Line 111: warning: exported method Request.WithBodyv should have comment or be unexported (golint)
    • Line 134: warning: exported method Response.WithHeaderv should have comment or be unexported (golint)
    • Line 153: warning: exported method Response.WithBodyv should have comment or be unexported (golint)
    • httptest/exec/cmds.go
    • Line 17: warning: exported method Context.Cmd_host should have comment or be unexported (golint)
    • Line 17: warning: don't use underscores in Go names; method Cmd_host should be CmdHost (golint)
    • Line 29: warning: exported method Context.Cmd_auth should have comment or be unexported (golint)
    • Line 29: warning: don't use underscores in Go names; method Cmd_auth should be CmdAuth (golint)
    • Line 54: warning: exported method Context.Cmd_println should have comment or be unexported (golint)
    • Line 54: warning: don't use underscores in Go names; method Cmd_println should be CmdPrintln (golint)
    • Line 59: warning: exported method Context.Cmd_echo should have comment or be unexported (golint)
    • Line 59: warning: don't use underscores in Go names; method Cmd_echo should be CmdEcho (golint)
    • Line 79: warning: exported method Context.Cmd_req should have comment or be unexported (golint)
    • Line 79: warning: don't use underscores in Go names; method Cmd_req should be CmdReq (golint)
    • Line 84: warning: exported method Context.Cmd_post should have comment or be unexported (golint)
    • Line 84: warning: don't use underscores in Go names; method Cmd_post should be CmdPost (golint)
    • Line 89: warning: exported method Context.Cmd_get should have comment or be unexported (golint)
    • Line 89: warning: don't use underscores in Go names; method Cmd_get should be CmdGet (golint)
    • Line 94: warning: exported method Context.Cmd_delete should have comment or be unexported (golint)
    • Line 94: warning: don't use underscores in Go names; method Cmd_delete should be CmdDelete (golint)
    • Line 99: warning: exported method Context.Cmd_put should have comment or be unexported (golint)
    • Line 99: warning: don't use underscores in Go names; method Cmd_put should be CmdPut (golint)
    • Line 111: warning: exported method Context.Cmd_header should have comment or be unexported (golint)
    • Line 111: warning: don't use underscores in Go names; method Cmd_header should be CmdHeader (golint)
    • Line 134: warning: exported method Context.Cmd_body should have comment or be unexported (golint)
    • Line 134: warning: don't use underscores in Go names; method Cmd_body should be CmdBody (golint)
    • Line 139: warning: exported method Context.Cmd_json should have comment or be unexported (golint)
    • Line 139: warning: don't use underscores in Go names; method Cmd_json should be CmdJSON (golint)
    • Line 144: warning: exported method Context.Cmd_bson should have comment or be unexported (golint)
    • Line 144: warning: don't use underscores in Go names; method Cmd_bson should be CmdBson (golint)
    • Line 149: warning: exported method Context.Cmd_form should have comment or be unexported (golint)
    • Line 149: warning: don't use underscores in Go names; method Cmd_form should be CmdForm (golint)
    • Line 158: warning: exported method Context.Cmd_binary should have comment or be unexported (golint)
    • Line 158: warning: don't use underscores in Go names; method Cmd_binary should be CmdBinary (golint)
    • Line 192: warning: exported method Context.Cmd_ret should have comment or be unexported (golint)
    • Line 192: warning: don't use underscores in Go names; method Cmd_ret should be CmdRet (golint)
    • Line 207: warning: exported method Context.Cmd_clear should have comment or be unexported (golint)
    • Line 207: warning: don't use underscores in Go names; method Cmd_clear should be CmdClear (golint)
    • Line 221: warning: exported method Context.Cmd_match should have comment or be unexported (golint)
    • Line 221: warning: don't use underscores in Go names; method Cmd_match should be CmdMatch (golint)
    • Line 245: warning: exported method Context.Cmd_let should have comment or be unexported (golint)
    • Line 245: warning: don't use underscores in Go names; method Cmd_let should be CmdLet (golint)
    • Line 260: warning: exported method Context.Cmd_equal should have comment or be unexported (golint)
    • Line 260: warning: don't use underscores in Go names; method Cmd_equal should be CmdEqual (golint)
    • Line 267: warning: exported method Context.Cmd_equalSet should have comment or be unexported (golint)
    • Line 267: warning: don't use underscores in Go names; method Cmd_equalSet should be CmdEqualSet (golint)
    • httptest/exec/multicase.go
    • Line 9: warning: should not use dot imports (golint)
    • Line 13: warning: exported var ErrUnexpected should have comment or be unexported (golint)
    • Line 14: warning: don't use underscores in Go names; var ErrSyntaxError_Case should be ErrSyntaxErrorCase (golint)
    • Line 15: warning: don't use underscores in Go names; var ErrSyntaxError_TearDown should be ErrSyntaxErrorTearDown (golint)
    • Line 20: warning: comment on exported type Case should be of the form "Case ..." (with optional leading article) (golint)
    • Line 45: warning: exported type Cases should have comment or be unexported (golint)
    • Line 51: warning: exported method Cases.Exec should have comment or be unexported (golint)
    • Line 63: warning: exported function ExecCases should have comment or be unexported (golint)
    • Line 93: warning: exported function ParseCases should have comment or be unexported (golint)
    • httptest/exec/subcmds.go
    • Line 20: warning: don't use underscores in Go names; method Eval_base64 should be EvalBase64 (golint)
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 43: warning: don't use underscores in Go names; method Eval_env should be EvalEnv (golint)
    • Line 58: warning: don't use underscores in Go names; method Eval_decode should be EvalDecode (golint)
    • Line 69: warning: don't use underscores in Go names; method Eval_envdecode should be EvalEnvdecode (golint)
    • httptest/assert.go
    • Line 29: warning: exported function Equal should have comment or be unexported (golint)
    • Line 42: warning: exported function EqualSet should have comment or be unexported (golint)
    • Line 96: warning: exported type Var should have comment or be unexported (golint)
    • Line 101: warning: exported method Var.Equal should have comment or be unexported (golint)
    • Line 106: warning: exported method Var.EqualObject should have comment or be unexported (golint)
    • Line 121: warning: exported method Var.EqualSet should have comment or be unexported (golint)
    • httptest/response.go
    • Line 59: warning: exported type Response should have comment or be unexported (golint)
    • Line 127: warning: exported method Response.WithHeader should have comment or be unexported (golint)
    • Line 146: warning: exported method Response.WithBodyf should have comment or be unexported (golint)
    • Line 151: warning: exported method Response.WithBody should have comment or be unexported (golint)
    • Line 196: warning: exported method Response.GetBody should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!