Skip to content

Commit

Permalink
Remove config provider interface pointer (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegrone authored Feb 26, 2022
1 parent 2683f22 commit 2a22b72
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func buildCLI() *cli.App {
cfgProvider := fs_config_provider.NewFSConfigProvider(configDir, env)

s := server.NewServer(
server_options.WithConfigProvider(&cfgProvider),
server_options.WithConfigProvider(cfgProvider),
)
defer s.Stop()
err := s.Start()
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type (
// NewServer returns a new instance of server that serves one or many services.
func NewServer(opts ...server_options.ServerOption) *Server {
serverOpts := server_options.NewServerOptions(opts)
cfgProvider, err := config.NewConfigProviderWithRefresh(*serverOpts.ConfigProvider)
cfgProvider, err := config.NewConfigProviderWithRefresh(serverOpts.ConfigProvider)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion server/server_options/server_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type (
)

// WithConfigProvider supplies the config for the UI server
func WithConfigProvider(cfgProvider *config.ConfigProvider) ServerOption {
func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption {
return newApplyFuncContainer(func(s *ServerOptions) {
s.ConfigProvider = cfgProvider
})
Expand Down
2 changes: 1 addition & 1 deletion server/server_options/server_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

type (
ServerOptions struct {
ConfigProvider *config.ConfigProvider
ConfigProvider config.ConfigProvider
}
)

Expand Down

0 comments on commit 2a22b72

Please sign in to comment.