Go
Unexported return type of the exported function
Warning
Code Style
New
Last modified: 03 December 2024Reports 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{}
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
GoExportedFuncWithUnexportedType
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Go, 243.23131 |
Thanks for your feedback!
Was this page helpful?