Skip to content

Commit e224b26

Browse files
committed
style: // nolint: → //nolint:
Signed-off-by: Maxime Soulé <[email protected]>
1 parent c72d04a commit e224b26

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

internal/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
// NoResponderFound is returned when no responders are found for a
99
// given HTTP method and URL.
10-
var NoResponderFound = errors.New("no responder found") // nolint: revive
10+
var NoResponderFound = errors.New("no responder found") //nolint: revive
1111

1212
// ErrorNoResponderFoundMistake encapsulates a NoResponderFound
1313
// error probably due to a user error on the method or URL path.

response.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ func NewBytesResponder(status int, body []byte) Responder {
576576
// To pass the content of an existing file as body use [File] as in:
577577
//
578578
// httpmock.NewJsonResponse(200, httpmock.File("body.json"))
579-
func NewJsonResponse(status int, body any) (*http.Response, error) { // nolint: revive
579+
func NewJsonResponse(status int, body any) (*http.Response, error) { //nolint: revive
580580
encoded, err := json.Marshal(body)
581581
if err != nil {
582582
return nil, err
@@ -592,7 +592,7 @@ func NewJsonResponse(status int, body any) (*http.Response, error) { // nolint:
592592
// To pass the content of an existing file as body use [File] as in:
593593
//
594594
// httpmock.NewJsonResponder(200, httpmock.File("body.json"))
595-
func NewJsonResponder(status int, body any) (Responder, error) { // nolint: revive
595+
func NewJsonResponder(status int, body any) (Responder, error) { //nolint: revive
596596
resp, err := NewJsonResponse(status, body)
597597
if err != nil {
598598
return nil, err
@@ -616,7 +616,7 @@ func NewJsonResponder(status int, body any) (Responder, error) { // nolint: revi
616616
// To pass the content of an existing file as body use [File] as in:
617617
//
618618
// httpmock.NewJsonResponderOrPanic(200, httpmock.File("body.json"))
619-
func NewJsonResponderOrPanic(status int, body any) Responder { // nolint: revive
619+
func NewJsonResponderOrPanic(status int, body any) Responder { //nolint: revive
620620
responder, err := NewJsonResponder(status, body)
621621
if err != nil {
622622
panic(err)
@@ -631,7 +631,7 @@ func NewJsonResponderOrPanic(status int, body any) Responder { // nolint: revive
631631
// To pass the content of an existing file as body use [File] as in:
632632
//
633633
// httpmock.NewXmlResponse(200, httpmock.File("body.xml"))
634-
func NewXmlResponse(status int, body any) (*http.Response, error) { // nolint: revive
634+
func NewXmlResponse(status int, body any) (*http.Response, error) { //nolint: revive
635635
var (
636636
encoded []byte
637637
err error
@@ -655,7 +655,7 @@ func NewXmlResponse(status int, body any) (*http.Response, error) { // nolint: r
655655
// To pass the content of an existing file as body use [File] as in:
656656
//
657657
// httpmock.NewXmlResponder(200, httpmock.File("body.xml"))
658-
func NewXmlResponder(status int, body any) (Responder, error) { // nolint: revive
658+
func NewXmlResponder(status int, body any) (Responder, error) { //nolint: revive
659659
resp, err := NewXmlResponse(status, body)
660660
if err != nil {
661661
return nil, err
@@ -679,7 +679,7 @@ func NewXmlResponder(status int, body any) (Responder, error) { // nolint: reviv
679679
// To pass the content of an existing file as body use [File] as in:
680680
//
681681
// httpmock.NewXmlResponderOrPanic(200, httpmock.File("body.xml"))
682-
func NewXmlResponderOrPanic(status int, body any) Responder { // nolint: revive
682+
func NewXmlResponderOrPanic(status int, body any) Responder { //nolint: revive
683683
responder, err := NewXmlResponder(status, body)
684684
if err != nil {
685685
panic(err)
@@ -746,7 +746,7 @@ func (d *dummyReadCloser) Read(p []byte) (n int, err error) {
746746

747747
func (d *dummyReadCloser) Close() error {
748748
d.setup()
749-
d.body.Seek(0, io.SeekEnd) // nolint: errcheck
749+
d.body.Seek(0, io.SeekEnd) //nolint: errcheck
750750
return nil
751751
}
752752

transport.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func (m *MockTransport) Responders() []string {
414414

415415
func runCancelable(responder Responder, req *http.Request) (*http.Response, error) {
416416
ctx := req.Context()
417-
if req.Cancel == nil && ctx.Done() == nil { // nolint: staticcheck
417+
if req.Cancel == nil && ctx.Done() == nil { //nolint: staticcheck
418418
resp, err := responder(req)
419419
return resp, internal.CheckStackTracer(req, err)
420420
}
@@ -432,7 +432,7 @@ func runCancelable(responder Responder, req *http.Request) (*http.Response, erro
432432

433433
go func() {
434434
select {
435-
case <-req.Cancel: // nolint: staticcheck
435+
case <-req.Cancel: //nolint: staticcheck
436436
resultch <- result{
437437
response: nil,
438438
err: errors.New("request canceled"),
@@ -707,7 +707,7 @@ found:
707707
if mr.responder != nil {
708708
m.regexpResponders = append(m.regexpResponders, rxResp)
709709
}
710-
break // nolint: staticcheck
710+
break //nolint: staticcheck
711711
}
712712

713713
mrk := matchRouteKey{
@@ -951,7 +951,7 @@ func sortedQuery(m url.Values) string {
951951
sort.Strings(keys)
952952

953953
var b bytes.Buffer
954-
var values []string // nolint: prealloc
954+
var values []string //nolint: prealloc
955955

956956
for _, k := range keys {
957957
// Do not alter the passed url.Values

transport_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ func TestMockTransportRespectsCancel(t *testing.T) {
684684
switch c.withCancel {
685685
case cancelReq:
686686
cancel := make(chan struct{}, 1)
687-
req.Cancel = cancel // nolint: staticcheck
687+
req.Cancel = cancel //nolint: staticcheck
688688
if c.cancelNow {
689689
cancel <- struct{}{}
690690
}
@@ -757,12 +757,12 @@ func TestMockTransportCallCountReset(t *testing.T) {
757757
require.CmpNoError(err)
758758

759759
buff := new(bytes.Buffer)
760-
json.NewEncoder(buff).Encode("{}") // nolint: errcheck
760+
json.NewEncoder(buff).Encode("{}") //nolint: errcheck
761761
_, err = http.Post(url2, "application/json", buff)
762762
require.CmpNoError(err)
763763

764764
buff.Reset()
765-
json.NewEncoder(buff).Encode(`{"pipo":"bingo"}`) // nolint: errcheck
765+
json.NewEncoder(buff).Encode(`{"pipo":"bingo"}`) //nolint: errcheck
766766
_, err = http.Post(url2, "application/json", buff)
767767
require.CmpNoError(err)
768768

@@ -808,12 +808,12 @@ func TestMockTransportCallCountZero(t *testing.T) {
808808
require.CmpNoError(err)
809809

810810
buff := new(bytes.Buffer)
811-
json.NewEncoder(buff).Encode("{}") // nolint: errcheck
811+
json.NewEncoder(buff).Encode("{}") //nolint: errcheck
812812
_, err = http.Post(url2, "application/json", buff)
813813
require.CmpNoError(err)
814814

815815
buff.Reset()
816-
json.NewEncoder(buff).Encode(`{"pipo":"bingo"}`) // nolint: errcheck
816+
json.NewEncoder(buff).Encode(`{"pipo":"bingo"}`) //nolint: errcheck
817817
_, err = http.Post(url2, "application/json", buff)
818818
require.CmpNoError(err)
819819

@@ -1122,7 +1122,7 @@ func TestSubmatches(t *testing.T) {
11221122
}{
11231123
{
11241124
Name: "GetSubmatch & n < 1",
1125-
Fn: func() { httpmock.GetSubmatch(req, 0) }, // nolint: errcheck
1125+
Fn: func() { httpmock.GetSubmatch(req, 0) }, //nolint: errcheck
11261126
PanicPrefix: "getting submatches starts at 1, not 0",
11271127
},
11281128
{

0 commit comments

Comments
 (0)