@@ -31,7 +31,7 @@ var _ = Describe("Pagerduty", func() {
31
31
// each startup of PagerDuty we need to verify the user's email for future requests
32
32
mux .HandleFunc ("/users/me" , func (w http.ResponseWriter , r * http.Request ) {
33
33
Expect (r .Method ).Should (Equal ("GET" ))
34
- fmt .
Fprint (
w ,
`{"user":{"email":"[email protected] "}}` )
34
+ _ , _ = fmt .
Fprint (
w ,
`{"user":{"email":"[email protected] "}}` )
35
35
})
36
36
var err error // err is declared to make clear the p is not created here, but is global
37
37
p , err = pagerduty .NewWithToken (
@@ -71,7 +71,7 @@ var _ = Describe("Pagerduty", func() {
71
71
Expect (r .Method ).Should (Equal ("PUT" ))
72
72
w .Header ().Set ("Content-Type" , "application/json" )
73
73
w .WriteHeader (http .StatusBadRequest )
74
- fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
74
+ _ , _ = fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
75
75
})
76
76
// Act
77
77
err := p .MoveToEscalationPolicy (escalationPolicyID )
@@ -87,7 +87,7 @@ var _ = Describe("Pagerduty", func() {
87
87
// Arrange
88
88
mux .HandleFunc ("/incidents" , func (w http.ResponseWriter , r * http.Request ) {
89
89
Expect (r .Method ).Should (Equal ("PUT" ))
90
- fmt .Fprint (w , `{}` )
90
+ _ , _ = fmt .Fprint (w , `{}` )
91
91
})
92
92
// Act
93
93
err := p .MoveToEscalationPolicy (escalationPolicyID )
@@ -124,7 +124,7 @@ var _ = Describe("Pagerduty", func() {
124
124
Expect (r .Method ).Should (Equal ("PUT" ))
125
125
w .Header ().Set ("Content-Type" , "application/json" )
126
126
w .WriteHeader (http .StatusBadRequest )
127
- fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
127
+ _ , _ = fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
128
128
})
129
129
// Act
130
130
err := p .AssignToUser (userID )
@@ -140,7 +140,7 @@ var _ = Describe("Pagerduty", func() {
140
140
// Arrange
141
141
mux .HandleFunc ("/incidents" , func (w http.ResponseWriter , r * http.Request ) {
142
142
Expect (r .Method ).Should (Equal ("PUT" ))
143
- fmt .Fprint (w , `{}` )
143
+ _ , _ = fmt .Fprint (w , `{}` )
144
144
})
145
145
// Act
146
146
err := p .AssignToUser (userID )
@@ -175,7 +175,7 @@ var _ = Describe("Pagerduty", func() {
175
175
Expect (r .Method ).Should (Equal ("PUT" ))
176
176
w .Header ().Set ("Content-Type" , "application/json" )
177
177
w .WriteHeader (http .StatusBadRequest )
178
- fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
178
+ _ , _ = fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
179
179
})
180
180
// Act
181
181
err := p .AcknowledgeIncident ()
@@ -191,7 +191,7 @@ var _ = Describe("Pagerduty", func() {
191
191
// Arrange
192
192
mux .HandleFunc ("/incidents" , func (w http.ResponseWriter , r * http.Request ) {
193
193
Expect (r .Method ).Should (Equal ("PUT" ))
194
- fmt .Fprint (w , `{}` )
194
+ _ , _ = fmt .Fprint (w , `{}` )
195
195
})
196
196
// Act
197
197
err := p .AcknowledgeIncident ()
@@ -216,7 +216,7 @@ var _ = Describe("Pagerduty", func() {
216
216
Expect (r .Method ).Should (Equal ("POST" ))
217
217
w .Header ().Set ("Content-Type" , "application/json" )
218
218
w .WriteHeader (http .StatusUnauthorized )
219
- fmt .Fprint (w , `{}` )
219
+ _ , _ = fmt .Fprint (w , `{}` )
220
220
})
221
221
// Act
222
222
err := p .AddNote (noteContent )
@@ -233,7 +233,7 @@ var _ = Describe("Pagerduty", func() {
233
233
Expect (r .Method ).Should (Equal ("POST" ))
234
234
w .Header ().Set ("Content-Type" , "application/json" )
235
235
w .WriteHeader (http .StatusBadRequest )
236
- fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
236
+ _ , _ = fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
237
237
})
238
238
// Act
239
239
err := p .AddNote (noteContent )
@@ -264,7 +264,7 @@ var _ = Describe("Pagerduty", func() {
264
264
// Arrange
265
265
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/notes" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
266
266
Expect (r .Method ).Should (Equal ("POST" ))
267
- fmt .Fprint (w , `{}` )
267
+ _ , _ = fmt .Fprint (w , `{}` )
268
268
})
269
269
// Act
270
270
err := p .AddNote (noteContent )
@@ -286,7 +286,7 @@ var _ = Describe("Pagerduty", func() {
286
286
Expect (r .Method ).Should (Equal ("GET" ))
287
287
w .Header ().Set ("Content-Type" , "application/json" )
288
288
w .WriteHeader (http .StatusUnauthorized )
289
- fmt .Fprint (w , `{}` )
289
+ _ , _ = fmt .Fprint (w , `{}` )
290
290
})
291
291
// Act
292
292
_ , err := p .GetAlertsForIncident (incidentID )
@@ -303,7 +303,7 @@ var _ = Describe("Pagerduty", func() {
303
303
Expect (r .Method ).Should (Equal ("GET" ))
304
304
w .Header ().Set ("Content-Type" , "application/json" )
305
305
w .WriteHeader (http .StatusBadRequest )
306
- fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
306
+ _ , _ = fmt .Fprintf (w , `{"error":{"code":%d}}` , pagerduty .InvalidInputParamsErrorCode )
307
307
})
308
308
// Act
309
309
_ , err := p .GetAlertsForIncident (incidentID )
@@ -321,7 +321,7 @@ var _ = Describe("Pagerduty", func() {
321
321
Expect (r .Method ).Should (Equal ("GET" ))
322
322
w .Header ().Set ("Content-Type" , "application/json" )
323
323
w .WriteHeader (http .StatusNotFound )
324
- fmt .Fprint (w , `{}` )
324
+ _ , _ = fmt .Fprint (w , `{}` )
325
325
})
326
326
// Act
327
327
_ , err := p .GetAlertsForIncident (incidentID )
@@ -337,7 +337,7 @@ var _ = Describe("Pagerduty", func() {
337
337
// Arrange
338
338
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/alerts" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
339
339
// CHGM format of
340
- fmt .Fprint (w , `{"alerts":[{"id":"123456","body":{"details":{"cluster_id": "123456"}}}]}` )
340
+ _ , _ = fmt .Fprint (w , `{"alerts":[{"id":"123456","body":{"details":{"cluster_id": "123456"}}}]}` )
341
341
})
342
342
// Act
343
343
res , err1 := p .GetAlertsForIncident (incidentID )
@@ -382,7 +382,7 @@ var _ = Describe("Pagerduty", func() {
382
382
When ("The service has no Dead Man's Snitch integrations" , func () {
383
383
It ("should return an IntegrationNotFoundError" , func () {
384
384
mux .HandleFunc (fmt .Sprintf ("/services/%s" , serviceID ), func (w http.ResponseWriter , r * http.Request ) {
385
- fmt .Fprintf (w , `{"service":{"id":"%s","integrations":[]}}` , serviceID )
385
+ _ , _ = fmt .Fprintf (w , `{"service":{"id":"%s","integrations":[]}}` , serviceID )
386
386
})
387
387
err := p .CreateNewAlert (newAlert , serviceID )
388
388
Expect (err ).To (HaveOccurred ())
@@ -392,10 +392,10 @@ var _ = Describe("Pagerduty", func() {
392
392
When ("The event creation fails" , func () {
393
393
It ("should return a CreateEventError" , func () {
394
394
mux .HandleFunc (fmt .Sprintf ("/services/%s" , serviceID ), func (w http.ResponseWriter , r * http.Request ) {
395
- fmt .Fprintf (w , `{"service":{"id":"%s","integrations":[{"id":"%s"}]}}` , serviceID , dmsIntegrationID )
395
+ _ , _ = fmt .Fprintf (w , `{"service":{"id":"%s","integrations":[{"id":"%s"}]}}` , serviceID , dmsIntegrationID )
396
396
})
397
397
mux .HandleFunc (fmt .Sprintf ("/services/%s/integrations/%s" , serviceID , dmsIntegrationID ), func (w http.ResponseWriter , r * http.Request ) {
398
- fmt .Fprintf (w , `{"integration":{"id":"%s","name":"%s"}}` , dmsIntegrationID , pagerduty .CADIntegrationName )
398
+ _ , _ = fmt .Fprintf (w , `{"integration":{"id":"%s","name":"%s"}}` , dmsIntegrationID , pagerduty .CADIntegrationName )
399
399
})
400
400
err := p .CreateNewAlert (newAlert , serviceID )
401
401
Expect (err ).To (HaveOccurred ())
@@ -481,7 +481,7 @@ var _ = Describe("Pagerduty", func() {
481
481
// Arrange
482
482
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/alerts" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
483
483
// Standard alert format of
484
- fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":{"cluster_id": "654321"}}}]}` )
484
+ _ , _ = fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":{"cluster_id": "654321"}}}]}` )
485
485
})
486
486
// Act
487
487
res , err := p .RetrieveClusterID ()
@@ -495,7 +495,7 @@ var _ = Describe("Pagerduty", func() {
495
495
// Arrange
496
496
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/alerts" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
497
497
// Standard alert format of
498
- fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":{"notes":"cluster_id: 654321"}}}]}` )
498
+ _ , _ = fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":{"notes":"cluster_id: 654321"}}}]}` )
499
499
})
500
500
// Act
501
501
res , err := p .RetrieveClusterID ()
@@ -508,7 +508,7 @@ var _ = Describe("Pagerduty", func() {
508
508
It ("should raise an error" , func () {
509
509
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/alerts" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
510
510
// Standard alert format of
511
- fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"describe":{"chicken": 1.75},"steak":true}}]}` )
511
+ _ , _ = fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"describe":{"chicken": 1.75},"steak":true}}]}` )
512
512
})
513
513
// Act
514
514
_ , err := p .RetrieveClusterID ()
@@ -519,7 +519,7 @@ var _ = Describe("Pagerduty", func() {
519
519
When ("the '.details' field is of the wrong type" , func () {
520
520
It ("should raise an error" , func () {
521
521
mux .HandleFunc (fmt .Sprintf ("/incidents/%s/alerts" , incidentID ), func (w http.ResponseWriter , r * http.Request ) {
522
- fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":"bad details"}}]}` )
522
+ _ , _ = fmt .Fprint (w , `{"alerts":[{"id":"1234","body":{"details":"bad details"}}]}` )
523
523
})
524
524
525
525
_ , err := p .RetrieveClusterID ()
0 commit comments