From 315d93d4efb039f3de83cb171cc8ead7dd69f6e4 Mon Sep 17 00:00:00 2001 From: nicerobot Date: Sat, 20 Jan 2018 17:43:24 -0800 Subject: [PATCH] go fmt. --- main.go | 37 ++++++++++++++++++------------------- main_test.go | 2 +- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/main.go b/main.go index af4e4bb..3554a25 100644 --- a/main.go +++ b/main.go @@ -1,17 +1,16 @@ - package main import ( - "errors" - "log" + "errors" + "log" - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambda" + "github.com/aws/aws-lambda-go/events" + "github.com/aws/aws-lambda-go/lambda" ) var ( - // ErrNameNotProvided is thrown when a name is not provided - ErrNameNotProvided = errors.New("no name was provided in the HTTP body") + // ErrNameNotProvided is thrown when a name is not provided + ErrNameNotProvided = errors.New("no name was provided in the HTTP body") ) // Handler is your Lambda function handler @@ -19,21 +18,21 @@ var ( // However you could use other event sources (S3, Kinesis etc), or JSON-decoded primitive types such as 'string'. func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - // stdout and stderr are sent to AWS CloudWatch Logs - log.Printf("Processing Lambda request %s\n", request.RequestContext.RequestID) + // stdout and stderr are sent to AWS CloudWatch Logs + log.Printf("Processing Lambda request %s\n", request.RequestContext.RequestID) - // If no name is provided in the HTTP request body, throw an error - if len(request.Body) < 1 { - return events.APIGatewayProxyResponse{}, ErrNameNotProvided - } + // If no name is provided in the HTTP request body, throw an error + if len(request.Body) < 1 { + return events.APIGatewayProxyResponse{}, ErrNameNotProvided + } - return events.APIGatewayProxyResponse{ - Body: "Hello " + request.Body, - StatusCode: 200, - }, nil + return events.APIGatewayProxyResponse{ + Body: "Hello " + request.Body, + StatusCode: 200, + }, nil } func main() { - lambda.Start(Handler) -} \ No newline at end of file + lambda.Start(Handler) +} diff --git a/main_test.go b/main_test.go index 120fc37..e31be08 100644 --- a/main_test.go +++ b/main_test.go @@ -3,7 +3,7 @@ package main_test import ( "testing" - main "github.com/aws-samples/lambda-go-samples" + "github.com/aws-samples/lambda-go-samples" "github.com/aws/aws-lambda-go/events" "github.com/stretchr/testify/assert"