← 返回首页
Go CodeQL queries for Code Quality - GitHub Docs
Skip to main content

Go CodeQL queries for Code Quality

Explore the queries that CodeQL uses to analyze code quality for code written in Go.

Copy as Markdown

Code Quality uses the following CodeQL queries to analyze Go code and detect code quality issues on:

  • Your default branch, with results shown on the repository's "Standard findings" dashboard
  • Pull requests, with findings shown as comments made by github-code-quality[bot]

Copilot Autofix suggestions are provided for findings where possible.

Query nameCategorySeverityUseless assignment to fieldUseless assignment to local variableBitwise exclusive-or used like exponentiationComparison of identical valuesConstant length comparisonDuplicate 'if' branchesDuplicate 'if' conditionDuplicate switch caseExpression has no effectIdentical operandsImpossible interface nil checkInconsistent direction of for loopMissing error checkOff-by-one comparison against lengthRedundant call to recoverRedundant check for negative valueSelf assignmentShift out of rangeUnreachable statementWhitespace contradicts operator precedenceWrapped error is always nilWritable file handle closed without error handling
MaintainabilityWarning
MaintainabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityError
ReliabilityError
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityError
ReliabilityWarning
ReliabilityError
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning
ReliabilityWarning

Help and support

Did you find what you needed?

Yes No
Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Learn how to contribute

Legal