Inspectopedia Help

Unexported return type of the exported function

Reports exported functions with unexported return types.

Unexported types can be difficult to use when viewing documentation under go doc.

Example:

type hidden struct{} func Exported() hidden { // Exported function with the `hidden` unexported return type return hidden{} }

You can apply Export quick-fix to export the type. After the quick-fix is applied, type name will be capitalized:

type Hidden struct{} func Exported() Hidden { // Fixed return Hidden{} }

Inspection Details

Available in:

GoLand 2023.3

Plugin:

Go, 233.SNAPSHOT

Last modified: 13 July 2023