Browse Source

fix staticcheck

afeiszli 2 years ago
parent
commit
4157ddb73a
4 changed files with 3 additions and 15 deletions
  1. 1 1
      .github/workflows/test.yml
  2. 0 10
      ee/license.go
  3. 0 4
      ee/types.go
  4. 2 0
      models/accessToken.go

+ 1 - 1
.github/workflows/test.yml

@@ -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"

+ 0 - 10
ee/license.go

@@ -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
-}

+ 0 - 4
ee/types.go

@@ -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"`
-}

+ 2 - 0
models/accessToken.go

@@ -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"`