Inspectopedia 2024.3 Help

Probable bugs

'FailNow' in a non-test goroutine   New in this release

Reports calls to testing.T.FailNow and similar methods located in goroutines in test files.

'Unmarshal' is called with the incorrect argument   New in this release

Reports calls to json.Unmarshal and similar functions if the argument that is passed to store the result is not a pointer or an interface.

'context.CancelFunc' is not called   New in this release

Reports execution paths that do not call the cancel function returned by context.WithCancel and similar functions.

Defer/go statement calls 'recover' or 'panic' directly   New in this release

Reports defer and go statements that call panic() or recover() directly.

Direct comparison of errors   New in this release

Reports direct comparison of errors, for example, using ==, and suggests using errors.Is instead.

Division by zero  

Reports division by zero.

Exceeded shift expression   New in this release

Reports shift expressions that equal or exceed the width of the integer.

Imported package name as a name identifier   New in this release

Reports declarations of variables, arguments or functions that overlap with the used import.

Impossible interface type assertion   New in this release

Reports impossible interface-to-interface type assertions.

Incorrect 'strings.Replace' count argument   New in this release

Reports strings.Replace calls with the replace count 0 instead of -1.

Incorrect usage of 'fmt.Printf' and 'fmt.Println' functions   New in this release

Reports incorrect usages of fmt.Printf, fmt.Println, and similar formatting and printing functions.

Incorrect usage of the 'errors.As' function   New in this release

Reports calls of the errors.As function when the second argument is not a pointer to an interface or to a type that implements an error.

Incorrect usage of the 'sync/atomic' package   New in this release

Reports assignment statements of the form x = atomic.AddUint64(&x, 1).

Integer to string type conversion   New in this release

Reports conversions of string(x)-alike expressions where x is an integer but not byte or rune.

Invalid conversions of 'uintptr' to 'unsafe.Pointer'   New in this release

Reports possibly incorrect conversions of uintptr to unsafe.Pointer.

Irregular usage of 'iota'   New in this release

Reports irregular usage of iota within a constant declaration.

Leading whitespace in directive comment   New in this release

Reports leading whitespaces before Go directives in comments.

Locks mistakenly passed by value   New in this release

Reports locks that are mistakenly passed by values.

Loop variables captured by the func literal   New in this release

Reports references to loop variables from within func literals in defer and go statements.

Malformed build tag   New in this release

Reports malformed build tags and build tags in the incorrect location.

Malformed struct tag   New in this release

Reports struct tags that do not conform to Go conventions for struct tags.

Missing 'case' statements for 'iota' consts in 'switch'   New in this release

Reports unhandled values in switch statements when the iota identifier is in the const declaration.

Mixed value and pointer receivers   New in this release

Reports structures with methods that use a mixture of types: value and pointer receivers.

Nilness analyzer   New in this release

Reports problems caused by incorrect usage of the nil value.

Non-standard signature for well-known function names   New in this release

Reports methods with certain names in the following cases: the method's name matches the name of several well-known interface methods from the standard library the signature does not match the signature of the corresponding interface method Such methods might indicate that the receiver type is intended to satisfy an interface from the standard library, but fails to do so because of the mistake in the method's signature.

Reserved word used as name  

Reports declarations of variables, arguments or functions that overlap with the built-in or reserved keyword.

Shadowing variable   New in this release

Reports declarations of variables that overlap with the declarations in the outer scope.

The 'go:debug' directive is ignored in Go versions earlier than 1.21   New in this release

Reports go:debug directive usages when a Go SDK version is less than 1.21.

The 'go:debug' directive must be placed before the package clause   New in this release

Reports 'go:debug' directive being defined not above main or _test packages.

Type assertion on errors fails on wrapped errors   New in this release

Reports type assertion or type switch on errors, for example, err.(*MyErr) or switch err.(type), and suggests using errors.As instead.

Unhandled error   New in this release

Reports calls to functions and methods that do not handle the call result of the error type.

Unused function or method call result   New in this release

Reports calls to certain functions and methods that do not handle a call result.

Last modified: 03 December 2024