diff options
author | Wolfy-J <[email protected]> | 2019-09-06 13:18:01 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-09-06 13:18:01 +0300 |
commit | d885d927c4d7ef42daf9953dd8b2a9f6dd6a75ea (patch) | |
tree | 676de4cb6113dca10b4d96d67e3059c83b1c4a3c | |
parent | 1d6b7c125c2d07c3ef646e9a90f3ebb422fa44df (diff) |
golint and go fmt
-rw-r--r-- | cmd/util/config.go | 14 | ||||
-rw-r--r-- | service/http/config.go | 2 | ||||
-rw-r--r-- | service/metrics/config.go | 1 |
3 files changed, 9 insertions, 8 deletions
diff --git a/cmd/util/config.go b/cmd/util/config.go index a1b3d25d..0a8d6005 100644 --- a/cmd/util/config.go +++ b/cmd/util/config.go @@ -9,28 +9,28 @@ import ( "strings" ) -// configWrapper provides interface bridge between v configs and service.Config. -type configWrapper struct { +// ConfigWrapper provides interface bridge between v configs and service.Config. +type ConfigWrapper struct { v *viper.Viper } // Get nested config section (sub-map), returns nil if section not found. -func (w *configWrapper) Get(key string) service.Config { +func (w *ConfigWrapper) Get(key string) service.Config { sub := w.v.Sub(key) if sub == nil { return nil } - return &configWrapper{sub} + return &ConfigWrapper{sub} } // Unmarshal unmarshal config data into given struct. -func (w *configWrapper) Unmarshal(out interface{}) error { +func (w *ConfigWrapper) Unmarshal(out interface{}) error { return w.v.Unmarshal(out) } // LoadConfig config and merge it's values with set of flags. -func LoadConfig(cfgFile string, path []string, name string, flags []string) (*configWrapper, error) { +func LoadConfig(cfgFile string, path []string, name string, flags []string) (*ConfigWrapper, error) { cfg := viper.New() if cfgFile != "" { @@ -124,7 +124,7 @@ func LoadConfig(cfgFile string, path []string, name string, flags []string) (*co return nil, err } - return &configWrapper{merged}, nil + return &ConfigWrapper{merged}, nil } func parseFlag(flag string) (string, string, error) { diff --git a/service/http/config.go b/service/http/config.go index ff15e83e..ba3e6300 100644 --- a/service/http/config.go +++ b/service/http/config.go @@ -94,7 +94,7 @@ func (c *Config) EnableHTTP2() bool { return c.HTTP2.Enabled } -// EnableH2С when HTTP/2 extension must be enabled on TCP. +// EnableH2C when HTTP/2 extension must be enabled on TCP. func (c *Config) EnableH2C() bool { return c.HTTP2.H2C } diff --git a/service/metrics/config.go b/service/metrics/config.go index b17fc0c9..c2f85201 100644 --- a/service/metrics/config.go +++ b/service/metrics/config.go @@ -6,6 +6,7 @@ import ( "github.com/spiral/roadrunner/service" ) +// Config configures metrics service. type Config struct { // Address to listen Address string |