diff options
| author | Teddy Wing | 2017-06-03 19:18:16 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-06-03 19:18:16 +0200 | 
| commit | e14edbd02a61fd1d999df1a4c242e30ca721046b (patch) | |
| tree | 9e94366ecce3dbcbb7b354b3af0232f53e83337b | |
| parent | 557d6fda17c5368d7f76e823bca00335afb7ee0c (diff) | |
| download | timetasker-e14edbd02a61fd1d999df1a4c242e30ca721046b.tar.bz2 | |
main.go: Handle errors from MaybeWriteConfig()
If the function results in an error, print it and exit.
| -rw-r--r-- | main.go | 8 | 
1 files changed, 7 insertions, 1 deletions
| @@ -29,7 +29,13 @@ var config Config  func main() {  	var err error -	MaybeWriteConfig() +	err = MaybeWriteConfig() +	if err != nil { +		fmt.Println("Could not write config file") +		fmt.Println(err) +		os.Exit(1) +	} +  	loadConfig()  	// Parse command line arguments | 
