add cross compile

This commit is contained in:
Chyroc 2018-04-17 21:06:29 +08:00
parent 8ece431fc4
commit b76248a81c
4 changed files with 9 additions and 21 deletions

View File

@ -3,9 +3,7 @@ package cfg
import (
"errors"
"log"
"runtime"
"strconv"
"strings"
)
type TomlConfig struct {
@ -37,22 +35,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"`

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,8 @@
// +build windows
package cfg
var DEFAULT_WINDOWS_TOML_CONFIG string = `[editor]
var DEFUALT_TOML_CONFIG = `[editor]
tab_size = 4
hungry_backspace = true
tabs_are_spaces = true