This commit is contained in:
davidnewhall2 2019-12-30 16:04:25 -08:00
parent 6350bf19e6
commit d3863975b6
1 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,9 @@ import (
"strings"
)
// Satisfy gomnd
const oneItem = 1
// GetSites returns a list of configured sites on the UniFi controller.
func (u *Unifi) GetSites() (Sites, error) {
var response struct {
@ -48,9 +51,9 @@ func (u *Unifi) GetSiteDPI(sites Sites) ([]*DPITable, error) {
return nil, err
}
if l := len(response.Data); l > 1 {
if l := len(response.Data); l > oneItem {
return nil, fmt.Errorf("dpi data table contains more than 1 item; please open a bug report")
} else if l != 1 {
} else if l != oneItem {
continue
}