From 1e26a960fa62b6d42eaf7ac20b2263f16dc90448 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Wed, 20 Sep 2023 09:10:42 -0400 Subject: [PATCH] statticcheck --- controllers/docs.go | 19 +++++++------------ controllers/network.go | 2 +- swagger.yml | 8 ++++---- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/controllers/docs.go b/controllers/docs.go index 625c29042..021f58028 100644 --- a/controllers/docs.go +++ b/controllers/docs.go @@ -237,11 +237,11 @@ type networkBodyParam struct { Network models.Network `json:"network"` } -// swagger:parameters updateNetwork updateNetwork updateNetworkNodeLimit deleteNetwork keyUpdate createAccessKey getAccessKeys updateNetworkACL getNetworkACL +// swagger:parameters updateNetwork updateNetwork updateNetworkNodeLimit keyUpdate createAccessKey getAccessKeys type networkPathParam struct { // Network // in: path - network string + Network string `json:"network"` } // swagger:response networkBodyResponse @@ -339,7 +339,7 @@ type HostID struct { } // swagger:parameters addHostToNetwork deleteHostFromNetwork -type hostFromNetworkParams struct { +type HostFromNetworkParams struct { // hostid to add or delete from network // in: path HostID string `json:"hostid"` @@ -349,20 +349,13 @@ type hostFromNetworkParams struct { } // swagger:parameters deleteEnrollmentKey -type deleteEnrollmentKeyParam struct { +type DeleteEnrollmentKeyParam struct { // in: path KeyID string `json:"keyid"` } -// swagger:parameters getEnrollmentKey createEnrollmentKey -type token struct { - // token - // in: path - token string -} - // swagger:parameters handleHostRegister -type registerParams struct { +type RegisterParams struct { // in: path Token string `json:"token"` // in: body @@ -448,5 +441,7 @@ func useUnused() bool { _ = hostPull{} _ = okRespone{} _ = signal{} + _ = filenameToGet{} + _ = dnsNetworkPathParam{} return false } diff --git a/controllers/network.go b/controllers/network.go index 3540504eb..9d4dc494b 100644 --- a/controllers/network.go +++ b/controllers/network.go @@ -30,7 +30,7 @@ func networkHandlers(r *mux.Router) { r.HandleFunc("/api/networks/{networkname}/acls", logic.SecurityCheck(true, http.HandlerFunc(getNetworkACL))).Methods(http.MethodGet) } -// swagger:route GET /api/networks networks getNetworks +// swagger:route GET /api/networks networks getAllNetworks // // Lists all networks. // diff --git a/swagger.yml b/swagger.yml index e5cbca635..cc681381f 100644 --- a/swagger.yml +++ b/swagger.yml @@ -1634,7 +1634,7 @@ paths: - hosts /api/networks: get: - operationId: getNetworks + operationId: getAllNetworks responses: "200": $ref: '#/responses/getNetworksSliceResponse' @@ -1664,10 +1664,10 @@ paths: operationId: updateNetwork parameters: - description: Network - in: body + in: path name: network - schema: - $ref: '#/definitions/Network' + required: true + type: string x-go-name: Network responses: "200":