Skip to content

Commit 69f2b2a

Browse files
committed
ignore linter warnings about ioutil package rename, and reformat with go 1.19 version of gofmt
1 parent 9254f38 commit 69f2b2a

33 files changed

+93
-87
lines changed

cfn/event_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package cfn
44

55
import (
66
"encoding/json"
7-
"io/ioutil"
7+
"io/ioutil" //nolint: staticcheck
88
"testing"
99

1010
"github.com/aws/aws-lambda-go/events/test"

cfn/response.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"bytes"
77
"encoding/json"
88
"fmt"
9-
"io/ioutil"
9+
"io/ioutil" //nolint: staticcheck
1010
"log"
1111
"net/http"
1212
)

cfn/wrap.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ func lambdaWrapWithClient(lambdaFunction CustomResourceFunction, client httpClie
7171
// plate is taken away from the customer and it makes writing a Custom Resource
7272
// simpler.
7373
//
74-
// func myLambda(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {
75-
// physicalResourceID = "arn:...."
76-
// return
77-
// }
74+
// func myLambda(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {
75+
// physicalResourceID = "arn:...."
76+
// return
77+
// }
7878
//
79-
// func main() {
80-
// lambda.Start(cfn.LambdaWrap(myLambda))
81-
// }
79+
// func main() {
80+
// lambda.Start(cfn.LambdaWrap(myLambda))
81+
// }
8282
func LambdaWrap(lambdaFunction CustomResourceFunction) (fn CustomResourceLambdaFunction) {
8383
return lambdaWrapWithClient(lambdaFunction, http.DefaultClient)
8484
}

cfn/wrap_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"context"
88
"encoding/json"
99
"errors"
10-
"io/ioutil"
10+
"io/ioutil" //nolint: staticcheck
1111
"net/http"
1212
"testing"
1313

cmd/build-lambda-zip/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"archive/zip"
77
"flag"
88
"fmt"
9-
"io/ioutil"
9+
"io/ioutil" //nolint: staticcheck
1010
"log"
1111
"os"
1212
"path/filepath"

cmd/build-lambda-zip/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package main
55
import (
66
"archive/zip"
77
"fmt"
8-
"io/ioutil"
8+
"io/ioutil" //nolint: staticcheck
99
"os"
1010
"os/exec"
1111
"path"

cmd/build-lambda-zip/testdata/apigw.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/aws/aws-lambda-go/lambda"
1010
)
1111

12-
func main () {
13-
lambda.Start(func (ctx context.Context, event events.APIGatewayV2HTTPRequest) (*events.APIGatewayProxyResponse, error) {
12+
func main() {
13+
lambda.Start(func(ctx context.Context, event events.APIGatewayV2HTTPRequest) (*events.APIGatewayProxyResponse, error) {
1414
return &events.APIGatewayProxyResponse{
1515
Body: fmt.Sprintf("Hello %v", event),
1616
}, nil

cmd/build-lambda-zip/testdata/noop.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
)
99

1010
type BinaryHandler func(context.Context, []byte) ([]byte, error)
11+
1112
func (bh BinaryHandler) Invoke(ctx context.Context, req []byte) ([]byte, error) {
1213
return bh(ctx, req)
1314
}
1415

15-
func noop (ctx context.Context, req []byte) ([]byte, error) {
16+
func noop(ctx context.Context, req []byte) ([]byte, error) {
1617
return req, nil
1718
}
1819

events/alb_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77

88
"github.com/aws/aws-lambda-go/events/test"

events/apigw_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package events
44

55
import (
66
"encoding/json"
7-
"io/ioutil"
7+
"io/ioutil" //nolint: staticcheck
88
"testing"
99

1010
"github.com/aws/aws-lambda-go/events/test"

events/appsync_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77

88
"github.com/aws/aws-lambda-go/events/test"

events/clientvpn_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77

88
"github.com/aws/aws-lambda-go/events/test"

events/codebuild.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ type CodeBuildEventDetail struct {
9393
CompletedPhaseEnd CodeBuildTime `json:"completed-phase-end"`
9494
}
9595

96-
//CodeBuildEventAdditionalInformation represents additional information to the code build event
96+
// CodeBuildEventAdditionalInformation represents additional information to the code build event
9797
type CodeBuildEventAdditionalInformation struct {
9898
Artifact CodeBuildArtifact `json:"artifact"`
9999

events/codebuild_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77
"time"
88

events/codedeploy_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"encoding/json"
55
"github.com/stretchr/testify/require"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88
"time"
99
)

events/codepipeline.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package events
22

33
// CodePipelineJob has been incorrectly assigned as CodePipelineEvent
4-
// - https://github.com/aws/aws-lambda-go/issues/244
4+
// - https://github.com/aws/aws-lambda-go/issues/244
5+
//
56
// This maintains backwards compatability until a v2 release
67
type CodePipelineEvent = CodePipelineJobEvent

events/codepipeline_cloudwatch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33
import (
44
"encoding/json"
55
"github.com/stretchr/testify/require"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88
"time"
99
)

events/codepipeline_job_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33

44
import (
55
"encoding/json"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88

99
"github.com/aws/aws-lambda-go/events/test"

events/codepipeline_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33

44
import (
55
"encoding/json"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88

99
"github.com/aws/aws-lambda-go/events/test"

events/cognito_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33

44
import (
55
"encoding/json"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88

99
"github.com/aws/aws-lambda-go/events/test"

events/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package events
33

44
import (
55
"encoding/json"
6-
"io/ioutil"
6+
"io/ioutil" //nolint: staticcheck
77
"testing"
88

99
"github.com/aws/aws-lambda-go/events/test"

events/iot_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77

88
"github.com/aws/aws-lambda-go/events/test"

events/lambda_function_urls_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package events
44

55
import (
66
"encoding/json"
7-
"io/ioutil"
7+
"io/ioutil" //nolint: staticcheck
88
"testing"
99

1010
"github.com/stretchr/testify/assert"

events/test/assert.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package test
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
5+
"io/ioutil" //nolint: staticcheck
66
"testing"
77

88
"github.com/stretchr/testify/assert"
99
)
1010

11-
//nolint: stylecheck
11+
// nolint: stylecheck
1212
func AssertJsonFile(t *testing.T, file string, o interface{}) {
1313
inputJSON, err := ioutil.ReadFile(file)
1414
if err != nil {
@@ -17,7 +17,7 @@ func AssertJsonFile(t *testing.T, file string, o interface{}) {
1717
AssertJsonBytes(t, inputJSON, o)
1818
}
1919

20-
//nolint: stylecheck
20+
// nolint: stylecheck
2121
func AssertJsonBytes(t *testing.T, inputJSON []byte, o interface{}) {
2222
// de-serialize
2323
if err := json.Unmarshal(inputJSON, o); err != nil {

events/test/jsonblobs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package test
22

3-
//nolint: stylecheck
3+
// nolint: stylecheck
44
func GetMalformedJson() []byte {
55
return []byte(`{ "Records`)
66
}

events/test/jsonsyntax.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88
)
99

10-
//nolint: stylecheck
10+
// nolint: stylecheck
1111
func TestMalformedJson(t *testing.T, objectToDeserialize interface{}) {
1212
// 1. read JSON from file
1313
inputJson := GetMalformedJson()

events/test/readjson.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
import (
4-
"io/ioutil"
4+
"io/ioutil" //nolint: staticcheck
55
"testing"
66
)
77

lambda/entry.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ import (
1414
//
1515
// Rules:
1616
//
17-
// * handler must be a function
18-
// * handler may take between 0 and two arguments.
19-
// * if there are two arguments, the first argument must satisfy the "context.Context" interface.
20-
// * handler may return between 0 and two arguments.
21-
// * if there are two return values, the second argument must be an error.
22-
// * if there is one return value it must be an error.
17+
// - handler must be a function
18+
// - handler may take between 0 and two arguments.
19+
// - if there are two arguments, the first argument must satisfy the "context.Context" interface.
20+
// - handler may return between 0 and two arguments.
21+
// - if there are two return values, the second argument must be an error.
22+
// - if there is one return value it must be an error.
2323
//
2424
// Valid function signatures:
2525
//
26-
// func ()
27-
// func () error
28-
// func (TIn) error
29-
// func () (TOut, error)
30-
// func (TIn) (TOut, error)
31-
// func (context.Context) error
32-
// func (context.Context, TIn) error
33-
// func (context.Context) (TOut, error)
34-
// func (context.Context, TIn) (TOut, error)
26+
// func ()
27+
// func () error
28+
// func (TIn) error
29+
// func () (TOut, error)
30+
// func (TIn) (TOut, error)
31+
// func (context.Context) error
32+
// func (context.Context, TIn) error
33+
// func (context.Context) (TOut, error)
34+
// func (context.Context, TIn) (TOut, error)
3535
//
3636
// Where "TIn" and "TOut" are types compatible with the "encoding/json" standard library.
3737
// See https://golang.org/pkg/encoding/json/#Unmarshal for how deserialization behaves
@@ -51,7 +51,7 @@ func StartWithContext(ctx context.Context, handler interface{}) {
5151
//
5252
// Handler implementation requires a single "Invoke()" function:
5353
//
54-
// func Invoke(context.Context, []byte) ([]byte, error)
54+
// func Invoke(context.Context, []byte) ([]byte, error)
5555
//
5656
// Deprecated: use lambda.Start(handler) instead
5757
func StartHandler(handler Handler) {
@@ -83,7 +83,7 @@ var (
8383
//
8484
// Handler implementation requires a single "Invoke()" function:
8585
//
86-
// func Invoke(context.Context, []byte) ([]byte, error)
86+
// func Invoke(context.Context, []byte) ([]byte, error)
8787
//
8888
// Deprecated: use lambda.StartWithOptions(handler, lambda.WithContext(ctx)) instead
8989
func StartHandlerWithContext(ctx context.Context, handler Handler) {

lambda/extensions_api_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8-
"io/ioutil"
8+
"io/ioutil" //nolint: staticcheck
99
"net/http"
1010
)
1111

0 commit comments

Comments
 (0)