Skip to content

Commit 876cdad

Browse files
committed
golangci-lint
1 parent da75c04 commit 876cdad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ typings/
5757
# Nuxt.js build / generate output
5858
.nuxt
5959
dist
60-
**/node_modules
60+
**/node_modules
61+
src/main

src/pkg/client/ical_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func (e *ICalClient) loadEvents(ctx context.Context, calName string, from string
256256
cal.Start, cal.End = &start, &end
257257

258258
if err := cal.Parse(); err != nil {
259-
return nil, humane.New(fmt.Sprintf("unable to parse iCal file %w", err), "ensure the iCal file is valid and follows the iCal spec")
259+
return nil, humane.Wrap(err, "unable to parse iCal file", "ensure the iCal file is valid and follows the iCal spec")
260260
}
261261

262262
// Sort Events by start-date (makes our live easier down the line)
@@ -369,15 +369,15 @@ func (e *ICalClient) getIcalFromURL(ctx context.Context, url string) (io.ReadClo
369369
if err != nil {
370370
span.RecordError(err)
371371
span.SetStatus(codes.Error, err.Error())
372-
return nil, humane.New(fmt.Sprintf("failed creating request for %s: %w", url, err), "")
372+
return nil, humane.Wrap(err, fmt.Sprintf("failed creating request for %s", url), "verify if URL is valid and well-formed")
373373
}
374374

375375
client := http.DefaultClient
376376
resp, err := client.Do(req)
377377
if err != nil {
378378
span.RecordError(err)
379379
span.SetStatus(codes.Error, err.Error())
380-
return nil, humane.New(fmt.Sprintf("failed making request to %s: %w", url, err), "verify if URL exists and is accessible")
380+
return nil, humane.Wrap(err, fmt.Sprintf("failed making request to %s", url), "verify if URL exists and is accessible")
381381
}
382382

383383
return resp.Body, nil

0 commit comments

Comments
 (0)