File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ type Config struct {
77
77
78
78
// Functional Options Pattern
79
79
// https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
80
- type option func (* Config ) error
80
+ type Option func (* Config ) error
81
81
82
82
// NewConfig creates a new Config and sets default values.
83
83
func NewConfig () * Config {
@@ -92,7 +92,7 @@ func NewConfig() *Config {
92
92
return cfg
93
93
}
94
94
95
- func (c * Config ) SetOptions (opts ... option ) error {
95
+ func (c * Config ) Apply (opts ... Option ) error {
96
96
for _ , opt := range opts {
97
97
err := opt (c )
98
98
if err != nil {
@@ -104,7 +104,7 @@ func (c *Config) SetOptions(opts ...option) error {
104
104
105
105
// TimeTruncate sets the time duration to truncate time.Time values in
106
106
// query parameters.
107
- func TimeTruncate (d time.Duration ) option {
107
+ func TimeTruncate (d time.Duration ) Option {
108
108
return func (cfg * Config ) error {
109
109
cfg .timeTruncate = d
110
110
return nil
You can’t perform that action at this time.
0 commit comments