File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 8
8
"go.uber.org/zap"
9
9
)
10
10
11
- const default_base_url = "https://fscdn.eppo.cloud/api"
11
+ const defaultBaseUrl = "https://fscdn.eppo.cloud/api"
12
+ const defaultPollerInterval = 10 * time .Second
12
13
13
14
type Config struct {
14
15
BaseUrl string
@@ -24,15 +25,18 @@ func (cfg *Config) validate() error {
24
25
}
25
26
26
27
if cfg .BaseUrl == "" {
27
- cfg .BaseUrl = default_base_url
28
+ cfg .BaseUrl = defaultBaseUrl
28
29
}
29
30
30
31
if cfg .PollerInterval <= 0 {
31
- cfg .PollerInterval = 10 * time . Second
32
+ cfg .PollerInterval = defaultPollerInterval
32
33
}
33
34
34
35
if cfg .ApplicationLogger == nil {
35
- defaultLogger , _ := zap .NewProduction ()
36
+ defaultLogger , err := zap .NewProduction (zap .IncreaseLevel (zap .WarnLevel ))
37
+ if err != nil {
38
+ return fmt .Errorf ("failed to create default logger: %v" , err )
39
+ }
36
40
cfg .ApplicationLogger = applicationlogger .NewZapLogger (defaultLogger )
37
41
}
38
42
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ type flagConfiguration struct {
22
22
TotalShards int64 `json:"totalShards"`
23
23
}
24
24
25
- func (f * flagConfiguration ) Precompute () {
26
- for i := range f .Allocations {
27
- f .Allocations [i ].Precompute ()
25
+ func (flag * flagConfiguration ) Precompute () {
26
+ for i := range flag .Allocations {
27
+ flag .Allocations [i ].Precompute ()
28
28
}
29
29
}
30
30
You can’t perform that action at this time.
0 commit comments