Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staticcheck report #714

Closed
mahjonp opened this issue Jan 9, 2020 · 1 comment · Fixed by #1195
Closed

Staticcheck report #714

mahjonp opened this issue Jan 9, 2020 · 1 comment · Fixed by #1195
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mahjonp
Copy link

mahjonp commented Jan 9, 2020

Staticcheck Report

  1. What did you do?
$ go get honnef.co/go/tools/cmd/staticcheck
$ GO111MODULE=on staticcheck ./...

ast/advisor.go:17:2: should not use dot imports (ST1001)
ast/ast.go:21:2: should not use dot imports (ST1001)
ast/base.go:99:6: type resultSetNode is unused (U1000)
ast/ddl.go:19:2: should not use dot imports (ST1001)
ast/ddl.go:2700:6: should omit comparison to bool constant, can be simplified to !n.Constraint.Enforced (S1002)
ast/ddl.go:2753:3: this value of col is never used (SA4006)
ast/ddl.go:2760:3: this value of constraint is never used (SA4006)
ast/dml.go:19:2: should not use dot imports (ST1001)
ast/dml.go:70:2: field resultSetNode is unused (U1000)
ast/dml.go:177:2: field resultSetNode is unused (U1000)
ast/dml.go:774:2: field resultSetNode is unused (U1000)
ast/dml.go:1065:2: field resultSetNode is unused (U1000)
ast/dml.go:1889:2: field resultSetNode is unused (U1000)
ast/expressions.go:23:2: should not use dot imports (ST1001)
ast/expressions.go:1183:12: this value of ok is never used (SA4006)
ast/functions.go:22:2: should not use dot imports (ST1001)
ast/misc.go:24:2: should not use dot imports (ST1001)
ast/misc_test.go:195:2: this value of pwd is never used (SA4006)
ast/stats.go:18:2: should not use dot imports (ST1001)
auth/auth.go:23:2: should not use dot imports (ST1001)
charset/charset.go:108:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008)
digester.go:117:11: should use d.buffer.String() instead of string(d.buffer.Bytes()) (S1030)
digester.go:124:15: should use d.buffer.String() instead of string(d.buffer.Bytes()) (S1030)
digester.go:247:2: redundant return statement (S1023)
digester.go:363:22: func (*tokenDeque).pushBack is unused (U1000)
goyacc/format_yacc.go:486:2: field readBytes is unused (U1000)
lexer_test.go:219:4: string literal contains the Unicode control character U+0005, consider using the '\x05' escape sequence (ST1018)
lexer_test.go:219:4: string literal contains the Unicode control character U+0018, consider using the '\x18' escape sequence (ST1018)
lexer_test.go:219:22: string literal contains the Unicode control character U+0005, consider using the '\x05' escape sequence (ST1018)
lexer_test.go:219:22: string literal contains the Unicode control character U+0018, consider using the '\x18' escape sequence (ST1018)
lexer_test.go:281:12: this value of lit is never used (SA4006)
lexer_test.go:283:2: this value of tok is never used (SA4006)
lexer_test.go:286:12: this value of lit is never used (SA4006)
lexer_test.go:290:12: this value of lit is never used (SA4006)
misc.go:96:2: redundant return statement (S1023)
model/model.go:620:2: only the first constant in this group has an explicit type (SA9004)
model/model_test.go:151:9: should use String() instead of fmt.Sprintf (S1025)
model/model_test.go:318:7: this value of err is never used (SA4006)
mysql/const.go:21:2: should not use dot imports (ST1001)
mysql/errcode.go:19:2: only the first constant in this group has an explicit type (SA9004)
opcode/opcode.go:21:2: should not use dot imports (ST1001)
parser_test.go:170:3: this value of ss is never used (SA4006)
parser_test.go:2869:2: this value of stmt is never used (SA4006)
parser_test.go:2871:2: this value of stmt is never used (SA4006)
parser_test.go:2874:2: this value of stmt is never used (SA4006)
parser_test.go:3296:2: this value of stmt is never used (SA4006)
parser_test.go:4127:2: this value of stmts is never used (SA4006)
test_driver/test_driver_datum.go:59:2: field collation is unused (U1000)
test_driver/test_driver_datum.go:60:2: field decimal is unused (U1000)
test_driver/test_driver_datum.go:61:2: field length is unused (U1000)
test_driver/test_driver_mydecimal.go:226:12: this value of wordsFrac is never used (SA4006)
yy_parser.go:52:2: var specCodePattern is unused (U1000)
yy_parser.go:58:2: var specVersionCodeValue is unused (U1000)
yy_parser.go:300:6: func getInt64FromNUM is unused (U1000)
  1. What version of TiDB SQL Parser are you using?

7de2c99

PTAL @Deardrops

@bb7133
Copy link
Member

bb7133 commented Oct 29, 2020

We'll check them recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants