File tree 2 files changed +9
-7
lines changed 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 53
53
proofChainFlag string
54
54
binaryFilePathFlag string
55
55
websocketURLsFlag string
56
- logsFolderFlag string = "./logs/"
56
+ logsFolderFlag = "./logs/"
57
57
58
58
// stream processing vars
59
59
start = ">"
@@ -315,7 +315,7 @@ func getLogLocationURL(logPath string) (*url.URL, error) {
315
315
// directory doesn't exist, create
316
316
createErr := os .Mkdir (locationURL .Path , os .ModePerm )
317
317
if createErr != nil {
318
- return nil , fmt .Errorf ("error creating the directory: %v " , createErr )
318
+ return nil , fmt .Errorf ("error creating the directory: %w " , createErr )
319
319
}
320
320
}
321
321
@@ -324,7 +324,7 @@ func getLogLocationURL(logPath string) (*url.URL, error) {
324
324
}
325
325
}
326
326
327
- return locationURL , err
327
+ return locationURL , fmt . Errorf ( "log-location: %w" , err )
328
328
}
329
329
330
330
func writable (path string ) bool {
Original file line number Diff line number Diff line change @@ -174,13 +174,14 @@ func DecodeAvro(record avro.AvroRecord, buffer []byte) error {
174
174
// 2. expands embedded environment variables
175
175
// 3. cleans the path, e.g. /a/b/../c -> /a/c
176
176
// Note, it has limitations, e.g. ~someuser/tmp will not be expanded
177
- func ExpandPath (p string ) string {
178
- if strings .HasPrefix (p , "~/" ) || strings .HasPrefix (p , "~\\ " ) {
177
+ func ExpandPath (fsPath string ) string {
178
+ if strings .HasPrefix (fsPath , "~/" ) || strings .HasPrefix (fsPath , "~\\ " ) {
179
179
if home := HomeDir (); home != "" {
180
- p = home + p [1 :]
180
+ fsPath = home + fsPath [1 :]
181
181
}
182
182
}
183
- return path .Clean (os .ExpandEnv (p ))
183
+
184
+ return path .Clean (os .ExpandEnv (fsPath ))
184
185
}
185
186
186
187
// HomeDir returns full path of home directory for current user
@@ -191,5 +192,6 @@ func HomeDir() string {
191
192
if usr , err := user .Current (); err == nil {
192
193
return usr .HomeDir
193
194
}
195
+
194
196
return ""
195
197
}
You can’t perform that action at this time.
0 commit comments