@@ -77,12 +77,12 @@ func getSystemPathForDisaster() string {
77
77
path , err := os .Executable ()
78
78
if err != nil {
79
79
log .WithFields (log.Fields {
80
- "package" : "cmd" ,
81
- "file" : "update.go" ,
80
+ "package" : "cmd" ,
81
+ "file" : "update.go" ,
82
82
"parent_function" : "getSystemPathForDisaster" ,
83
- "function" : "os.Executable" ,
84
- "error" : err ,
85
- "data" : nil ,
83
+ "function" : "os.Executable" ,
84
+ "error" : err ,
85
+ "data" : nil ,
86
86
}).Error ("Error getting system path" , ISSUE_MSG )
87
87
}
88
88
return path
@@ -103,13 +103,13 @@ func checkForNewRelease() (bool, error) {
103
103
resp , err := client .Do (req )
104
104
if err != nil {
105
105
log .WithFields (log.Fields {
106
- "package" : "cmd" ,
107
- "file" : "update.go" ,
106
+ "package" : "cmd" ,
107
+ "file" : "update.go" ,
108
108
"parent_function" : "checkForNewRelease" ,
109
- "function" : "client.Do" ,
110
- "error" : err ,
111
- "data" : nil ,
112
- }).Fatal ("Error initaiting connection to, " ,url , ISSUE_MSG )
109
+ "function" : "client.Do" ,
110
+ "error" : err ,
111
+ "data" : nil ,
112
+ }).Fatal ("Error initaiting connection to, " , url , ISSUE_MSG )
113
113
}
114
114
defer resp .Body .Close ()
115
115
@@ -118,12 +118,12 @@ func checkForNewRelease() (bool, error) {
118
118
// Unmarshal the JSON to the Github Release strcut
119
119
if err := json .NewDecoder (resp .Body ).Decode (& release ); err != nil {
120
120
log .WithFields (log.Fields {
121
- "package" : "cmd" ,
122
- "file" : "update.go" ,
121
+ "package" : "cmd" ,
122
+ "file" : "update.go" ,
123
123
"parent_function" : "checkForNewRelease" ,
124
- "function" : "json.NewDecoder" ,
125
- "error" : err ,
126
- "data" : nil ,
124
+ "function" : "json.NewDecoder" ,
125
+ "error" : err ,
126
+ "data" : nil ,
127
127
}).Fatal ("Error unmarshalling Github response" , ISSUE_MSG )
128
128
}
129
129
@@ -151,12 +151,12 @@ func getReleaseURL() (string, string, error) {
151
151
resp , err := client .Do (req )
152
152
if err != nil {
153
153
log .WithFields (log.Fields {
154
- "package" : "cmd" ,
155
- "file" : "update.go" ,
154
+ "package" : "cmd" ,
155
+ "file" : "update.go" ,
156
156
"parent_function" : "getReleaseURL" ,
157
- "function" : "client.Do" ,
158
- "error" : err ,
159
- "data" : req ,
157
+ "function" : "client.Do" ,
158
+ "error" : err ,
159
+ "data" : req ,
160
160
}).Fatal ("Error connecting to the Github API" , ISSUE_MSG )
161
161
}
162
162
defer resp .Body .Close ()
@@ -166,12 +166,12 @@ func getReleaseURL() (string, string, error) {
166
166
// Unmarshal the JSON to the Github Release strcut
167
167
if err := json .NewDecoder (resp .Body ).Decode (& release ); err != nil {
168
168
log .WithFields (log.Fields {
169
- "package" : "cmd" ,
170
- "file" : "update.go" ,
169
+ "package" : "cmd" ,
170
+ "file" : "update.go" ,
171
171
"parent_function" : "getReleaseURL" ,
172
- "function" : "client.Do" ,
173
- "error" : err ,
174
- "data" : req ,
172
+ "function" : "client.Do" ,
173
+ "error" : err ,
174
+ "data" : req ,
175
175
}).Error ("Error unmarshaling Github Release data." , ISSUE_MSG )
176
176
}
177
177
@@ -291,7 +291,7 @@ func DownloadFile(filePath string, url string) error {
291
291
"parent_function" : "DownloadFile" ,
292
292
"function" : "os.Create" ,
293
293
"error" : err ,
294
- "data" : fmt.Sprint ((tmpDir + pathOSeperator + "download.tmp" ),
294
+ "data" : fmt .Sprint ((tmpDir + pathOSeperator + "download.tmp" )) ,
295
295
}).Error ("Error creating temp directory." , ISSUE_MSG )
296
296
return err
297
297
}
@@ -491,12 +491,12 @@ func DownloadFile(filePath string, url string) error {
491
491
err := os .Rename ("disaster.tmp" , "disaster" )
492
492
if err != nil {
493
493
log .WithFields (log.Fields {
494
- "package" : "cmd" ,
495
- "file" : "update.go" ,
494
+ "package" : "cmd" ,
495
+ "file" : "update.go" ,
496
496
"parent_function" : "DownloadFile" ,
497
- "function" : "os.Rename"
498
- "error" : err ,
499
- "data" : "disaster.tmp, disaster" ,
497
+ "function" : "os.Rename" ,
498
+ "error" : err ,
499
+ "data" : "disaster.tmp, disaster" ,
500
500
}).Fatal ("Rename failed:" , ISSUE_MSG )
501
501
return err
502
502
}
0 commit comments