From 580e87bcc982f2c907abdaae291bf5188a7c3a9f Mon Sep 17 00:00:00 2001
From: makeworld <colecmac@protonmail.com>
Date: Thu, 27 Aug 2020 18:52:38 -0400
Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Add=20.golangci.yml,=20run=20gof?=
 =?UTF-8?q?mt,=20add=20PR=20to=20changelog?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .github/workflows/golangci-lint.yml |  3 ---
 .golangci.yml                       | 38 +++++++++++++++++++++++++++++
 CHANGELOG.md                        |  1 +
 display/private.go                  |  4 +--
 4 files changed, 41 insertions(+), 5 deletions(-)
 create mode 100644 .golangci.yml

diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index c8a8ea7..4f64e86 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -11,8 +11,5 @@ jobs:
         with:
           # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
           version: v1.30
-
-          # Optional: golangci-lint command line arguments.
-          args: --max-issues-per-linter=0 --exclude-use-default --disable-all -E deadcode -E errcheck -E gosimple -E govet -E ineffassign -E staticcheck -E structcheck -E typecheck -E unused -E varcheck -E dupl -E exhaustive -E exportloopref -E goconst -E gocritic -E goerr113 -E gofmt -E goimports -E golint -E goprintffuncname -E interfacer -E lll -E maligned -E misspell -E nakedret -E nolintlint -E prealloc -E scopelint -E unconvert -E unparam
           # Optional: show only new issues if it's a pull request. The default value is `false`.
           only-new-issues: true
diff --git a/.golangci.yml b/.golangci.yml
new file mode 100644
index 0000000..e010a47
--- /dev/null
+++ b/.golangci.yml
@@ -0,0 +1,38 @@
+linters:
+  fast: false
+  disable-all: true
+  enable:
+    - deadcode
+    - errcheck
+    - gosimple
+    - govet
+    - ineffassign
+    - staticcheck
+    - structcheck
+    - typecheck
+    - unused
+    - varcheck
+    - dupl
+    - exhaustive
+    - exportloopref
+    - goconst
+    - gocritic
+    - goerr113
+    - gofmt
+    - goimports
+    - golint
+    - goprintffuncname
+    - interfacer
+    - lll
+    - maligned
+    - misspell
+    - nakedret
+    - nolintlint
+    - prealloc
+    - scopelint
+    - unconvert
+    - unparam
+
+issues:
+  exclude-use-default: true
+  max-issues-per-linter: 0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d72347e..bc0dc85 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - The `shift_numbers` key in the config was added, so that non US keyboard users can navigate tabs (#64)
 - <kbd>F1</kbd> and <kbd>F2</kbd> keys for navigating to the previous and next tabs (#64)
 - Resolving any relative path (starting with a `.`) in the bottom bar is supported, not just `..` (#71)
+- Set programs in config to open other schemes like `gopher://` or `magnet:` (#74)
 
 ### Changed
 - Update to [go-gemini](https://github.com/makeworld-the-better-one/go-gemini) v0.8.4
diff --git a/display/private.go b/display/private.go
index c56b270..828390e 100644
--- a/display/private.go
+++ b/display/private.go
@@ -174,13 +174,13 @@ func handleOther(u string) {
 	}
 	switch handler {
 	case "", "off":
-		Error("URL Error", "Opening " + parsed.Scheme + " URLs is turned off.")
+		Error("URL Error", "Opening "+parsed.Scheme+" URLs is turned off.")
 	default:
 		// The config has a custom command to execute for URLs
 		fields := strings.Fields(handler)
 		err := exec.Command(fields[0], append(fields[1:], u)...).Start()
 		if err != nil {
-			Error("URL Error", "Error executing custom command: " + err.Error())
+			Error("URL Error", "Error executing custom command: "+err.Error())
 		}
 	}
 	App.Draw()