diff --git a/config/config.go b/config/config.go index 17f0273..85e946d 100644 --- a/config/config.go +++ b/config/config.go @@ -39,7 +39,7 @@ var bkmkPath string var DownloadsDir string // Command for opening HTTP(S) URLs in the browser, from "a-general.http" in config. -var HttpCommand []string +var HTTPCommand []string //nolint:golint,goerr113 func Init() error { @@ -241,12 +241,12 @@ func Init() error { } // Otherwise it's black by default // Parse HTTP command - HttpCommand = viper.GetStringSlice("a-general.http") - if len(HttpCommand) == 0 { + HTTPCommand = viper.GetStringSlice("a-general.http") + if len(HTTPCommand) == 0 { // Not a string array, interpret as a string instead // Split on spaces to maintain compatibility with old versions // The new better way to is to just define a string array in config - HttpCommand = strings.Fields(viper.GetString("a-general.http")) + HTTPCommand = strings.Fields(viper.GetString("a-general.http")) } return nil diff --git a/display/private.go b/display/private.go index dc73f35..474d998 100644 --- a/display/private.go +++ b/display/private.go @@ -146,10 +146,10 @@ func setPage(t *tab, p *structs.Page) { // handleHTTP is used by handleURL. // It opens HTTP links and displays Info and Error modals. func handleHTTP(u string, showInfo bool) { - if len(config.HttpCommand) == 1 { + if len(config.HTTPCommand) == 1 { // Possibly a non-command - switch strings.TrimSpace(config.HttpCommand[0]) { + switch strings.TrimSpace(config.HTTPCommand[0]) { case "", "off": Error("HTTP Error", "Opening HTTP URLs is turned off.") case "default": @@ -163,10 +163,10 @@ func handleHTTP(u string, showInfo bool) { } else { // Custom command var err error = nil - if len(config.HttpCommand) > 1 { - err = exec.Command(config.HttpCommand[0], append(config.HttpCommand[1:], u)...).Start() + if len(config.HTTPCommand) > 1 { + err = exec.Command(config.HTTPCommand[0], append(config.HTTPCommand[1:], u)...).Start() } else { - err = exec.Command(config.HttpCommand[0], u).Start() + err = exec.Command(config.HTTPCommand[0], u).Start() } if err != nil { Error("HTTP Error", "Error executing custom browser command: "+err.Error())