We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc53d78 commit 10f09eaCopy full SHA for 10f09ea
cmd/slackMessageParser/main.go
@@ -9,6 +9,7 @@ package main
9
import (
10
"encoding/json"
11
"fmt"
12
+ "log"
13
"os"
14
"path/filepath"
15
"strconv"
@@ -75,7 +76,11 @@ type CSVRecord struct {
75
76
func main() {
77
files, err := filepath.Glob("../../SlackMessages/*.json")
78
if err != nil {
- fmt.Println(err)
79
+ log.Fatal(err)
80
+ }
81
+
82
+ if len(files) == 0 {
83
+ log.Fatal("Could not find *.json files in the ./SlackMessages directory")
84
}
85
86
messages := make([]*Message, 0)
@@ -149,7 +154,7 @@ func main() {
149
154
150
155
csvFile, err := os.Create("../../slack_records.csv")
151
156
152
157
153
158
159
defer csvFile.Close()
160
0 commit comments