autojson
makes it easier to return JSON responses and errors for APIs.
To add autojson
to your project, simply go get
it:
go get -u github.com/nlowe/autojson
autojson
accepts a wide variety of handler functions. See the godoc
for details. In general, your handlers now return concrete types and an optional HTTP Status Code and/or error,
autojson
takes care of the serialization. See the example for more details.
This project makes use of Go Modules. You need Go 1.12+ to fully utilize it.
autojson
is licensed under the MIT License. It is inspired by the AWS Lambda Go SDK, which is licensed under the
Apache 2 License and can be found at https://github.com/aws/aws-lambda-go.