Created
December 29, 2019 17:20
-
-
Save JNaeemGitonga/8ce8aeb7c6b661649eb14bc1b32a48ff to your computer and use it in GitHub Desktop.
func marshalJSONAndSend(res []Story) (events.APIGatewayProxyResponse, error) {..}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func marshalJSONAndSend(res []Story) (events.APIGatewayProxyResponse, error) { | |
response, err := json.Marshal(res) | |
if err != nil { | |
return handleError(err) | |
} | |
return events.APIGatewayProxyResponse{ | |
Body: string(response), | |
StatusCode: 200, | |
}, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment