chore: minor
This commit is contained in:
parent
0700882648
commit
9d8e2b19d5
1 changed files with 2 additions and 5 deletions
|
|
@ -57,11 +57,8 @@ func NewGoEFromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if cc.URI != "" && cc.Token != "" {
|
||||
return nil, errors.New("should only have one of uri/token")
|
||||
}
|
||||
if cc.URI == "" && cc.Token == "" {
|
||||
return nil, errors.New("must have one of uri/token")
|
||||
if (cc.URI != "") == (cc.Token != "") {
|
||||
return nil, errors.New("must have either uri or token")
|
||||
}
|
||||
|
||||
return NewGoE(cc.URI, cc.Token, cc.Cache)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue