项目作者: chidiwilliams

项目描述 :
Example project demonstrating tips for writing web servers in Go
高级语言: Go
项目地址: git://github.com/chidiwilliams/go-web-server-tips.git
创建时间: 2020-04-28T13:47:30Z
项目社区:https://github.com/chidiwilliams/go-web-server-tips

开源协议:

下载


go-web-server-tips

This project demonstrates some code practices I use when writing web servers in Go.

To start, run:

shell script go run main.go

Blog post: dev.to/chidiwilliams/writing-cleaner-go-web-servers-3oe4

Tips

  • [x] Use clean architecture

    • Good code organization/folder structure
    • Decouple dependencies
  • [x] Extend HTTP handler

    • Handle errors in one location
  • [x] Standardized response format

  • [x] Create custom errors for client errors

    • Clean error handling
  • [ ] ozzo-validator with custom validator?

    • Struct validation outside controller
  • [ ] Integration testing with testify?