Skip to content

Commit 519ff7b

Browse files
committed
Misc. updates
1 parent 7fb73fb commit 519ff7b

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

api/api.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ type provider struct {
4040

4141
// Init initializes the api
4242
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
4844

4945
if config.Address == "" {
5046
config.Address = ":3030"

config/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
// Config represents a configuration
2222
type Config struct {
2323
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"`
2727
}
2828

2929
// Search represents the structure of the config search field
@@ -33,14 +33,14 @@ type Search struct {
3333
Timeout time.Duration `yaml:"-"`
3434
}
3535

36-
// Listen represents listen field in a config struct
36+
// Listen represents the structure of the config listen field
3737
type Listen struct {
3838
Address string `yaml:"address"`
3939
Path string `yaml:"path"`
4040
Providers string `yaml:"providers"`
4141
}
4242

43-
// Provider represents providers field in a config struct
43+
// Provider represents the structure of the config provider field
4444
type Provider struct {
4545
Provider string `yaml:"provider"`
4646
Name string `yaml:"name"`

search/search.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ var (
2222

2323
// Init initializes the search
2424
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
3026

3127
// Iterate config and create the config map for providers
3228
cm := []map[string]interface{}{}

0 commit comments

Comments
 (0)