File tree Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,7 @@ type provider struct {
40
40
41
41
// Init initializes the api
42
42
func Init (c conf.Config ) {
43
- if c .Listen != nil {
44
- config = * c .Listen
45
- } else {
46
- config = conf.Listen {}
47
- }
43
+ config = c .Listen
48
44
49
45
if config .Address == "" {
50
46
config .Address = ":3030"
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ import (
21
21
// Config represents a configuration
22
22
type Config struct {
23
23
File string
24
- Search * Search `yaml:"search"`
25
- Listen * Listen `yaml:"listen"`
26
- Providers []* Provider `yaml:"providers"`
24
+ Search Search `yaml:"search"`
25
+ Listen Listen `yaml:"listen"`
26
+ Providers []Provider `yaml:"providers"`
27
27
}
28
28
29
29
// Search represents the structure of the config search field
@@ -33,14 +33,14 @@ type Search struct {
33
33
Timeout time.Duration `yaml:"-"`
34
34
}
35
35
36
- // Listen represents listen field in a config struct
36
+ // Listen represents the structure of the config listen field
37
37
type Listen struct {
38
38
Address string `yaml:"address"`
39
39
Path string `yaml:"path"`
40
40
Providers string `yaml:"providers"`
41
41
}
42
42
43
- // Provider represents providers field in a config struct
43
+ // Provider represents the structure of the config provider field
44
44
type Provider struct {
45
45
Provider string `yaml:"provider"`
46
46
Name string `yaml:"name"`
Original file line number Diff line number Diff line change 22
22
23
23
// Init initializes the search
24
24
func Init (c conf.Config ) {
25
- if c .Search != nil {
26
- config = * c .Search
27
- } else {
28
- config = conf.Search {}
29
- }
25
+ config = c .Search
30
26
31
27
// Iterate config and create the config map for providers
32
28
cm := []map [string ]interface {}{}
You can’t perform that action at this time.
0 commit comments