← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~troyanov/maas:zerologlint into maas:master

 

Anton Troyanov has proposed merging ~troyanov/maas:zerologlint into maas:master.

Commit message:
ci(go): update golangci linter, enable zerologlint


Requested reviews:
  MAAS Lander (maas-lander)
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/444029
-- 
Your team MAAS Maintainers is requested to review the proposed merge of ~troyanov/maas:zerologlint into maas:master.
diff --git a/.golangci.yaml b/.golangci.yaml
index 9f41cd2..8d4ad72 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -91,6 +91,7 @@ linters:
     - unused
     - whitespace
     - wsl
+    - zerologlint
 
 linters-settings:
   errcheck:
diff --git a/Makefile b/Makefile
index e4d1a4e..1cca37e 100644
--- a/Makefile
+++ b/Makefile
@@ -442,7 +442,7 @@ snap-tree-sync: $(UI_BUILD) go-bins $(SNAP_UNPACKED_DIR_MARKER)
 		$(SNAP_UNPACKED_DIR)/usr/sbin/
 .PHONY: snap-tree-sync
 
-$(BIN_DIR)/golangci-lint: GOLANGCI_VERSION=1.51.2
+$(BIN_DIR)/golangci-lint: GOLANGCI_VERSION=1.53.1
 $(BIN_DIR)/golangci-lint: utilities/get_golangci-lint | $(BIN_DIR)
 	GOBIN="$(realpath $(dir $@))"
 	sh utilities/get_golangci-lint "v$(GOLANGCI_VERSION)"
diff --git a/src/host-info/cmd/machine-resources/main.go b/src/host-info/cmd/machine-resources/main.go
index 75b64b3..7557578 100644
--- a/src/host-info/cmd/machine-resources/main.go
+++ b/src/host-info/cmd/machine-resources/main.go
@@ -1,3 +1,6 @@
+//go:build linux
+// +build linux
+
 // Copyright 2014-2020 Canonical Ltd.  This software is licensed under the
 // GNU Affero General Public License version 3 (see the file LICENSE).
 
diff --git a/src/host-info/pkg/info/info.go b/src/host-info/pkg/info/info.go
index b31470c..edecc3d 100644
--- a/src/host-info/pkg/info/info.go
+++ b/src/host-info/pkg/info/info.go
@@ -1,3 +1,6 @@
+//go:build linux
+// +build linux
+
 // Copyright 2022 Canonical Ltd.  This software is licensed under the
 // GNU Affero General Public License version 3 (see the file LICENSE).