fix: Config should embed a pointer to s5config.NodeConfig
This commit is contained in:
parent
daf63268eb
commit
1a9fa9c4be
|
@ -8,7 +8,7 @@ import (
|
|||
var _ config.ProtocolConfig = (*Config)(nil)
|
||||
|
||||
type Config struct {
|
||||
s5config.NodeConfig
|
||||
*s5config.NodeConfig
|
||||
DbPath string `mapstructure:"db_path"`
|
||||
}
|
||||
|
||||
|
|
|
@ -145,12 +145,14 @@ func configureS5Protocol(proto *S5Protocol) (*s5config.NodeConfig, error) {
|
|||
|
||||
cfg.DB = db
|
||||
|
||||
return interface{}(cfg).(*s5config.NodeConfig), nil
|
||||
return cfg.NodeConfig, nil
|
||||
}
|
||||
|
||||
func (s *S5Protocol) Config() config.ProtocolConfig {
|
||||
if s.config == nil {
|
||||
s.config = &Config{}
|
||||
s.config = &Config{
|
||||
NodeConfig: &s5config.NodeConfig{},
|
||||
}
|
||||
}
|
||||
|
||||
return s.config
|
||||
|
|
Loading…
Reference in New Issue