Looking for a Go framework similar to FastAPI

Need help finding a quick-start Go framework for API development

Hey everyone! I’m new to Go and want to build a REST and WebSocket API service. I’m wondering if there’s a framework that can help me get started quickly.

I know Go isn’t big on doing everything for you, but I’d really like to avoid writing validators for REST endpoints. It’s such a pain for testing! Also, I don’t want to create custom responders for JSON and every possible error.

One more thing: I’m hoping to find something that generates API documentation automatically. You know, like OpenAPI specs, Swagger, and ReDoc.

Does anyone know of a Go framework that fits the bill? Something that’s easy to pick up but still powerful enough for real-world use? Thanks in advance for any suggestions!

check out echo framework. it’s pretty solid for api dev. handles validation nicely and has good json support. for docs, you can use echo-swagger. it’s not as fancy as fastapi but gets the job done. the learning curve ain’t bad either. give it a shot, might be what ur looking for!

I’d recommend checking out the Gin framework for Go. It’s widely used and has a lot of the features you’re looking for. Gin is known for its speed and efficiency, which is great for building REST APIs.

For validation, you can pair Gin with the go-playground/validator package. It integrates smoothly and handles most validation scenarios you’ll encounter.

As for API documentation, Gin works well with Swaggo. It allows you to generate Swagger 2.0 docs from your Go code annotations. While it’s not as automatic as FastAPI, it’s still a solid solution for keeping your API docs up-to-date.

Gin has a gentle learning curve and extensive documentation. It strikes a good balance between providing helpful features and staying true to Go’s philosophy of simplicity. Give it a try - it might be just what you need for your project.

I’ve been using the Fiber framework for Go, and it’s been a game-changer for my API development. It’s lightning-fast and has a syntax that’s easy to pick up, especially if you’re familiar with Express.js.

Fiber handles a lot of the heavy lifting for you. It’s got built-in support for request validation, which has saved me countless hours of writing and testing custom validators. The JSON responders are a breeze to use, and error handling is pretty straightforward too.

As for API documentation, Fiber integrates well with Swagger. I use the swag library alongside Fiber to auto-generate OpenAPI specs. It’s not quite as seamless as FastAPI, but it gets the job done without too much hassle.

The learning curve isn’t too steep, and the community is pretty active if you run into issues. Give it a shot - I think it might be what you’re looking for!