exported func NewSsmFactory returns unexported type *ssm.ssmFactory, which can be annoying to use
14 sharedPath string
15}
16
17func NewSsmFactory(log lager.Logger, session *session.Session, secretTemplates []*creds.SecretTemplate, sharedPath string) *ssmFactory {18 return &ssmFactory{
19 log: log,
20 api: ssm.New(session),
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")
}