Last active
August 29, 2015 13:57
-
-
Save ijonas/9719722 to your computer and use it in GitHub Desktop.
Reading in a config file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if configBytes, err := ioutil.ReadFile(fmt.Sprintf("%s/%s", os.Getenv("HOME"), ".ddknife")); err == nil { | |
for _, row := range strings.Split(string(configBytes), "\n") { | |
if tuple := strings.Split(row, "="); len(tuple) == 2 { | |
configFileSettings[tuple[0]] = tuple[1] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment