Skip to content

Commit

Permalink
Linting improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtsson committed Feb 17, 2020
1 parent 4241bcf commit 10149d3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 54 deletions.
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

27 changes: 19 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
{
"go.autocompleteUnimportedPackages": true,
"go.buildOnSave": "workspace",
"go.coverageOptions": "showUncoveredCodeOnly",
"go.coverOnSave": true,
"go.useLanguageServer": true,
"go.formatTool": "goimports",
"go.enableCodeLens": {
"references": false,
"runtest": true
},
"[go]": {
"editor.codeActionsOnSaveTimeout": 3000,
"editor.snippetSuggestions": "top",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.formatOnSave": true,
"editor.snippetSuggestions": "top",
},
"go.languageServerExperimentalFeatures": {
"format": true,
"diagnostics": true,
"documentLink": true
},
"gopls": {
"usePlaceholders": true, // add parameter placeholders when completing a function


// Experimental settings
"completeUnimported": true, // autocomplete unimported packages
"watchFileChanges": true, // watch file changes outside of the editor
"deepCompletion": true // enable deep completion

// If true, enable additional analyses with staticcheck.
// Warning: This will significantly increase memory usage.
"staticcheck": false,
},
"files.eol": "\n" // formatting only supports LF line endings
}
26 changes: 0 additions & 26 deletions .vscode/tasks.json

This file was deleted.

1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package notificationhubs provides a module for Microsoft Azure Notification Hubs.
package notificationhubs

import "time"
Expand Down
4 changes: 2 additions & 2 deletions send.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (h *NotificationHub) send(ctx context.Context, n *Notification, tags *strin
_url.Path = path.Join(_url.Path, "schedulednotifications")
headers["ServiceBusNotification-ScheduleTime"] = deliverTime.Format("2006-01-02T15:04:05")
} else {
return nil, nil, errors.New("You can not schedule a notification in the past")
return nil, nil, errors.New("you can not schedule a notification in the past")
}
} else {
_url.Path = path.Join(_url.Path, "messages")
Expand Down Expand Up @@ -128,7 +128,7 @@ func (h *NotificationHub) sendDirect(ctx context.Context, n *Notification, devic

func (h *NotificationHub) sendDirectBatch(ctx context.Context, n *Notification, deviceHandles []string) (raw []byte, telemetry *NotificationTelemetry, err error) {
if len(deviceHandles) > 1000 {
err = errors.New("You can not batch send to more than 1,000 devices")
err = errors.New("you can not batch send to more than 1,000 devices")
return
}

Expand Down
2 changes: 1 addition & 1 deletion send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func Test_NotificationScheduleSuccess(t *testing.T) {

func Test_NotificationScheduleOutdated(t *testing.T) {
var (
expectedError = errors.New("You can not schedule a notification in the past")
expectedError = errors.New("you can not schedule a notification in the past")
nhub, notification, _ = initNotificationTestItems()
)
b, _, err := nhub.Schedule(context.Background(), notification, nil, time.Now().Add(-time.Minute))
Expand Down
2 changes: 1 addition & 1 deletion telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewNotificationTelemetryFromLocationURL(url string) *NotificationTelemetry
// Notification Telemetry is only available for Standard tier Notification Hubs.
func NewNotificationTelemetryFromHTTPResponse(response *http.Response) (*NotificationTelemetry, error) {
if response == nil || response.Header == nil {
return nil, errors.New("Could not parse telemetry from response")
return nil, errors.New("could not parse telemetry from response")
}
location := response.Header.Get("location")
if len(location) == 0 {
Expand Down

0 comments on commit 10149d3

Please sign in to comment.