(msg string, exitCode int)
| 414 | } |
| 415 | |
| 416 | func fatal(msg string, exitCode int) { |
| 417 | debugLog := viper.GetString(varLog) |
| 418 | if len(debugLog) > 0 { |
| 419 | f, _ := os.OpenFile(debugLog, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644) |
| 420 | defer f.Close() |
| 421 | f.WriteString(msg + "\n") |
| 422 | } |
| 423 | |
| 424 | fmt.Fprintln(os.Stderr, msg) |
| 425 | os.Exit(exitCode) |
| 426 | } |
| 427 | |
| 428 | func makeStamp() float64 { |
| 429 | return float64(time.Now().UnixNano()) / float64(time.Second) |
no test coverage detected