fix staticcheck

This commit is contained in:
afeiszli 2022-09-19 13:27:30 -04:00
parent d0a75532e8
commit 4157ddb73a
4 changed files with 3 additions and 15 deletions

View file

@ -81,7 +81,7 @@ jobs:
sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
go test -p 1 ./... -v
go install honnef.co/go/tools/cmd/staticcheck@latest
{ ~/go/bin/staticcheck -tags=ee ./... ; ~/go/bin/staticcheck ./... ; } | ~/go/bin/staticcheck -merge
{ ~/go/bin/staticcheck -tags=ee ./... ; }
env:
DATABASE: sqlite
CLIENT_MODE: "off"

View file

@ -239,13 +239,3 @@ func getCachedResponse() ([]byte, error) {
func ClearLicenseCache() error {
return database.DeleteRecord(database.CACHE_TABLE_NAME, license_cache_key)
}
func getServerCount() int {
if record, err := database.FetchRecord(database.SERVERCONF_TABLE_NAME, server_id_key); err == nil {
currentServerIDs := serverIDs{}
if err = json.Unmarshal([]byte(record), &currentServerIDs); err == nil {
return len(currentServerIDs.ServerIDs)
}
}
return 1
}

View file

@ -81,7 +81,3 @@ type ValidateLicenseRequest struct {
type licenseResponseCache struct {
Body []byte `json:"body" binding:"required"`
}
type serverIDs struct {
ServerIDs []string `json:"server_ids" binding:"required"`
}

View file

@ -1,10 +1,12 @@
package models
// AccessToken - token used to access netmaker
type AccessToken struct {
APIConnString string `json:"apiconnstring"`
ClientConfig
}
// ClientConfig - the config of the client
type ClientConfig struct {
Network string `json:"network"`
Key string `json:"key"`