I am writing a package that exposes this function:
func Marshal(input interface{}) ([]byte, error)
This is fine for the majority of situations, but I also want to prove another function if there are extra options:
type MarshalOptions struct {
OnlyStdClass bool
}
My first thought is to create another function:
func MarshalWithOptions(input interface{}, options MarshalOptions) ([]byte, error)
Is this the recommended way of doing this? Is there a standard naming convention for function that also provide a more specific version with options?