From 5a9236f0a5abc2a1b4168af879fa98d77463e5b7 Mon Sep 17 00:00:00 2001
From: Christoph Witzko <github@christophwitzko.com>
Date: Fri, 13 Jan 2023 13:51:05 +0100
Subject: [PATCH] style: add .golangci-lint.yaml

---
 .golangci.yaml           | 25 +++++++++++++++++++++++++
 pkg/condition/default.go |  7 +++----
 2 files changed, 28 insertions(+), 4 deletions(-)
 create mode 100644 .golangci.yaml

diff --git a/.golangci.yaml b/.golangci.yaml
new file mode 100644
index 0000000..f5c0478
--- /dev/null
+++ b/.golangci.yaml
@@ -0,0 +1,25 @@
+linters:
+  enable:
+    - errorlint
+    - forbidigo
+    - gochecknoinits
+    - gocritic
+    - goconst
+    - gocyclo
+    - gofumpt
+    - goimports
+    - misspell
+    - revive
+    - unconvert
+    - unparam
+    - wastedassign
+
+linters-settings:
+  gocyclo:
+    min-complexity: 12
+  gofumpt:
+    extra-rules: true
+  govet:
+    enable-all: true
+    disable:
+      - fieldalignment
diff --git a/pkg/condition/default.go b/pkg/condition/default.go
index 14dd7d3..9e60847 100644
--- a/pkg/condition/default.go
+++ b/pkg/condition/default.go
@@ -1,12 +1,12 @@
 package condition
 
 import (
-	"io/ioutil"
+	"os"
 	"strings"
 )
 
 func ReadGitHead() string {
-	data, err := ioutil.ReadFile(".git/HEAD")
+	data, err := os.ReadFile(".git/HEAD")
 	if err != nil {
 		return ""
 	}
@@ -15,8 +15,7 @@ func ReadGitHead() string {
 
 var CIVERSION = "dev"
 
-type DefaultCI struct {
-}
+type DefaultCI struct{}
 
 func (d *DefaultCI) Version() string {
 	return CIVERSION
-- 
GitLab