revid: setting revid's config in revid.New

This commit is contained in:
Saxon Milton 2019-09-12 07:47:46 +00:00
parent 9769a3c4a9
commit fe49be41ad
1 changed files with 5 additions and 0 deletions

View File

@ -119,6 +119,11 @@ type Revid struct {
// an error if construction of the new instance was not successful. // an error if construction of the new instance was not successful.
func New(c Config, ns *netsender.Sender) (*Revid, error) { func New(c Config, ns *netsender.Sender) (*Revid, error) {
r := Revid{ns: ns, err: make(chan error)} r := Revid{ns: ns, err: make(chan error)}
err := r.setConfig(c)
if err != nil {
return nil, fmt.Errorf("could not set config, failed with error: %v",err)
}
r.config.Logger.SetLevel(c.LogLevel)
go r.handleErrors() go r.handleErrors()
return &r, nil return &r, nil
} }