Update Golang CI Lint to the latest version (#113)

This change updates Golang CI Lint to the latest version and fixes new
linter errors that came along with the update.

These changes were split out of #112 and are required to update the Go
version.
This commit is contained in:
Philip Laine
2026-02-27 19:07:58 +01:00
committed by GitHub
parent de74776007
commit 8ec7c8ded8
8 changed files with 61 additions and 50 deletions
@@ -222,7 +222,8 @@ var _ = Describe("NBResource Controller", func() {
resourceUpdated := false
mux.HandleFunc("/api/networks/test/resources/test", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
if r.Method == http.MethodGet {
switch r.Method {
case http.MethodGet:
resp := api.NetworkResource{
Address: nbresource.Spec.Address,
Description: &networkDescription,
@@ -245,7 +246,7 @@ var _ = Describe("NBResource Controller", func() {
Expect(err).NotTo(HaveOccurred())
_, err = w.Write(bs)
Expect(err).NotTo(HaveOccurred())
} else if r.Method == http.MethodPut {
case http.MethodPut:
resourceUpdated = true
bs, err := io.ReadAll(r.Body)
Expect(err).NotTo(HaveOccurred())