diff --git a/cfg/config.go b/cfg/config.go index 0572d7b..610d24b 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -3,9 +3,7 @@ package cfg import ( "errors" "log" - "runtime" "strconv" - "strings" ) type TomlConfig struct { @@ -33,22 +31,6 @@ type FileAssociations struct { Extensions []string } -var DEFUALT_TOML_CONFIG string = getDefaultConfig() - -func getDefaultConfig() string { - switch strings.ToLower(runtime.GOOS) { - case "windows": - return DEFAULT_WINDOWS_TOML_CONFIG - case "linux": - return DEFAULT_LINUX_TOML_CONFIG - case "darwin": - return DEFAULT_MAC_TOML_CONFIG - } - - // fallback is a windows config. - return DEFAULT_WINDOWS_TOML_CONFIG -} - type SyntaxCriteria struct { Colour int `toml:"colouring"` Match []string `toml:"match"` diff --git a/cfg/windowsconfig.go b/cfg/config_any.go similarity index 92% rename from cfg/windowsconfig.go rename to cfg/config_any.go index d809115..ac122a0 100644 --- a/cfg/windowsconfig.go +++ b/cfg/config_any.go @@ -1,6 +1,8 @@ +// +build !linux,!darwin + package cfg -var DEFAULT_WINDOWS_TOML_CONFIG string = `[editor] +var DEFUALT_TOML_CONFIG = `[editor] tab_size = 4 hungry_backspace = true tabs_are_spaces = true diff --git a/cfg/linuxconfig.go b/cfg/config_linux.go similarity index 93% rename from cfg/linuxconfig.go rename to cfg/config_linux.go index 787e0de..20d0e88 100644 --- a/cfg/linuxconfig.go +++ b/cfg/config_linux.go @@ -1,6 +1,8 @@ +// +build linux + package cfg -var DEFAULT_LINUX_TOML_CONFIG string = `[editor] +var DEFUALT_TOML_CONFIG = `[editor] tab_size = 4 hungry_backspace = true tabs_are_spaces = true diff --git a/cfg/macconfig.go b/cfg/config_mac.go similarity index 93% rename from cfg/macconfig.go rename to cfg/config_mac.go index 15c14b2..08cdb6b 100644 --- a/cfg/macconfig.go +++ b/cfg/config_mac.go @@ -1,6 +1,8 @@ +// +build darwin + package cfg -var DEFAULT_MAC_TOML_CONFIG string = `[editor] +var DEFUALT_TOML_CONFIG = `[editor] tab_size = 4 hungry_backspace = true tabs_are_spaces = true