Go Tutorial #21: Input Validation and API Best Practices
In the previous tutorial, you learned how to read and write files in Go. Now let’s focus on making your APIs production-ready. Building an API that works is one thing. Building an API that is reliable, secure, and easy to use is another. In this tutorial, you will learn the best practices that separate hobby projects from production services. Input Validation with validator Manual validation gets messy fast. The go-playground/validator package lets you validate structs with tags: ...