Skip to content

Commit

Permalink
Merge pull request #4 from mjtrangoni/fix-linter-issues
Browse files Browse the repository at this point in the history
Fix goconst issues
  • Loading branch information
ErenKizilay authored and erenkzly committed Jun 17, 2019
2 parents 95299de + 5ed8009 commit 2823349
Show file tree
Hide file tree
Showing 64 changed files with 408 additions and 272 deletions.
8 changes: 6 additions & 2 deletions account/request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package account

import "github.com/opsgenie/opsgenie-go-sdk-v2/client"
import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

type GetRequest struct {
client.BaseRequest
Expand All @@ -15,5 +19,5 @@ func (r *GetRequest) ResourcePath() string {
}

func (r *GetRequest) Method() string {
return "GET"
return http.MethodGet
}
4 changes: 3 additions & 1 deletion alert/acknowledge_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -28,7 +30,7 @@ func (r *AcknowledgeAlertRequest) ResourcePath() string {
}

func (r *AcknowledgeAlertRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AcknowledgeAlertRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/add_details_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -33,7 +35,7 @@ func (r *AddDetailsRequest) ResourcePath() string {
}

func (r *AddDetailsRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AddDetailsRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/add_note_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -31,7 +33,7 @@ func (r *AddNoteRequest) ResourcePath() string {
}

func (r *AddNoteRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AddNoteRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/add_responder.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -40,7 +42,7 @@ func (r *AddResponderRequest) ResourcePath() string {
}

func (r *AddResponderRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AddResponderRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/add_tags_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -33,7 +35,7 @@ func (r *AddTagsRequest) ResourcePath() string {
}

func (r *AddTagsRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AddTagsRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/add_team_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -33,7 +35,7 @@ func (r *AddTeamRequest) ResourcePath() string {
}

func (r *AddTeamRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AddTeamRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/assign_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -33,7 +35,7 @@ func (r *AssignRequest) ResourcePath() string {
}

func (r *AssignRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *AssignRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/close_alert_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -28,7 +30,7 @@ func (r *CloseAlertRequest) ResourcePath() string {
}

func (r *CloseAlertRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *CloseAlertRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/count_alerts_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

Expand All @@ -20,7 +22,7 @@ func (r *CountAlertsRequest) ResourcePath() string {
}

func (r *CountAlertsRequest) Method() string {
return "GET"
return http.MethodGet
}

func (r *CountAlertsRequest) RequestParams() map[string]string {
Expand Down
6 changes: 4 additions & 2 deletions alert/create_alert_attachment_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package alert

import (
"errors"
"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"io"
"net/http"
"os"
"path"
"strings"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

type CreateAlertAttachmentRequest struct {
Expand Down Expand Up @@ -53,7 +55,7 @@ func (r *CreateAlertAttachmentRequest) ResourcePath() string {
}

func (r *CreateAlertAttachmentRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *CreateAlertAttachmentRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/create_alert_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package alert

import (
"errors"
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

Expand Down Expand Up @@ -35,5 +37,5 @@ func (r *CreateAlertRequest) ResourcePath() string {
}

func (r *CreateAlertRequest) Method() string {
return "POST"
return http.MethodPost
}
4 changes: 3 additions & 1 deletion alert/create_saved_search_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -36,5 +38,5 @@ func (r *CreateSavedSearchRequest) ResourcePath() string {
}

func (r *CreateSavedSearchRequest) Method() string {
return "POST"
return http.MethodPost
}
4 changes: 3 additions & 1 deletion alert/delete_alert_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

Expand All @@ -25,7 +27,7 @@ func (r *DeleteAlertRequest) ResourcePath() string {
}

func (r *DeleteAlertRequest) Method() string {
return "DELETE"
return http.MethodDelete
}

func (r *DeleteAlertRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/delete_attachment_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -30,7 +32,7 @@ func (r *DeleteAttachmentRequest) ResourcePath() string {
}

func (r *DeleteAttachmentRequest) Method() string {
return "DELETE"
return http.MethodDelete
}

func (r *DeleteAttachmentRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/delete_saved_search_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

Expand All @@ -24,7 +26,7 @@ func (r *DeleteSavedSearchRequest) ResourcePath() string {
}

func (r *DeleteSavedSearchRequest) Method() string {
return "DELETE"
return http.MethodDelete
}

func (r *DeleteSavedSearchRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/escalate_to_next_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -33,7 +35,7 @@ func (r *EscalateToNextRequest) ResourcePath() string {
}

func (r *EscalateToNextRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *EscalateToNextRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/execute_custom_action.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -32,7 +34,7 @@ func (r *ExecuteCustomActionAlertRequest) ResourcePath() string {
}

func (r *ExecuteCustomActionAlertRequest) Method() string {
return "POST"
return http.MethodPost
}

func (r *ExecuteCustomActionAlertRequest) RequestParams() map[string]string {
Expand Down
8 changes: 6 additions & 2 deletions alert/get_alert_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package alert

import "github.com/opsgenie/opsgenie-go-sdk-v2/client"
import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

type GetAlertRequest struct {
client.BaseRequest
Expand All @@ -21,7 +25,7 @@ func (r *GetAlertRequest) ResourcePath() string {
}

func (r *GetAlertRequest) Method() string {
return "GET"
return http.MethodGet
}

func (r *GetAlertRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/get_attachment_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -29,7 +31,7 @@ func (r *GetAttachmentRequest) ResourcePath() string {
}

func (r *GetAttachmentRequest) Method() string {
return "GET"
return http.MethodGet
}

func (r *GetAttachmentRequest) RequestParams() map[string]string {
Expand Down
4 changes: 3 additions & 1 deletion alert/get_request_status_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alert

import (
"net/http"

"github.com/opsgenie/opsgenie-go-sdk-v2/client"
"github.com/pkg/errors"
)
Expand All @@ -23,5 +25,5 @@ func (r *GetRequestStatusRequest) ResourcePath() string {
}

func (r *GetRequestStatusRequest) Method() string {
return "GET"
return http.MethodGet
}
Loading

0 comments on commit 2823349

Please sign in to comment.