mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-26 23:15:42 +08:00
fix staticcheck
This commit is contained in:
parent
d0a75532e8
commit
4157ddb73a
4 changed files with 3 additions and 15 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -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"
|
||||
|
|
|
@ -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), ¤tServerIDs); err == nil {
|
||||
return len(currentServerIDs.ServerIDs)
|
||||
}
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
|
|
Loading…
Add table
Reference in a new issue