exported method Kind returns unexported type *kind_registry.nodeRegistryEntry, which can be annoying to use
68 return result
69}
70
71func (r *KindRegistry) Kind(kind string) *nodeRegistryEntry { 72 return r.nodeIndex[kind]
73}
74
Description
An exported function or method returning a value of an unexported type may be frustrating to use.
In Go, if the function or method starts with a lowercase letter, it is not exported outside the package.
Bad practice
type unexportedType string
func ExportedFunc() *unexportedType {
return &unexportedType("some string")
}
Recommended
type ExportedType string
func ExportedFunc() *ExportedType {
return &ExportedType("some string")
}