diygoapi
golang-standards/project-layout
diygoapi | golang-standards/project-layout | |
---|---|---|
8 | 195 | |
456 | 45,978 | |
- | 1.3% | |
4.8 | 6.4 | |
about 23 hours ago | about 2 months ago | |
Go | Makefile | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
diygoapi
-
How I Error - 2 years later
Hi Go reddit community! For my https://github.com/gilcrest/diygoapi project, I recently re-refactored the way I do errors (this is like my 5th time over the years). I wrote a quick post and updated the README with details - the post is here: https://dangillis.dev/posts/errors-again/
- Structuring a Golang API
-
Introducing go-api-basic - another template/boilerplate RESTful web server
Great idea. Added Issue 20
-
Codebase to learn golang code stucture
Hey - I've been working on something like this for a while. Take a look - https://github.com/gilcrest/go-api-basic - as others have said this is really an opinionated thing, there are no standards, but I've found some ways of structuring web apis that I like over the years. I'm still learning and making changes, so it's in no way static, but you may get some ideas.
-
SQL Transactions with Repository/Clean Architecture Pattern
I have been working on a project called go-api-basic for a while now and setup what I think is a decent way of implementing transactions. In my datastore package I have a Datastorer interface, with a DB() method to return the sql.DB, a BeginTx method to begin a Transaction, a RollbackTx method to rollback a transaction and a CommitTx method for committing. The Datastore struct implements this interface and has appropriate error handling, etc. In my controller package, you can see how I use this towards the end of the CreateMovie method. I've actually been working on this thing for 3.5 years and this is the first time I've ever posted on reddit about it haha, hope it helps.
-
I just started learning Go. Could you recommend me some nicely written simple projects (e.g. server) I could take a look at to learn from?
I am writing a simple project like this called go-api-basic - I'm in the middle of adding tests (I know, wrong order) and rewriting the README, but what's there you may find helpful.
golang-standards/project-layout
-
The power of the CLI with Golang and Cobra CLI
cmd: here where we will leave the main.go that starts our app.
-
What's your go to literature to build Go libraries?
> https://github.com/golang-standards/project-layout
The name of the repo is really and intentionally misleading. rsc filled an issue there to point this out, but the repo maintainer just disabled issues altogether so now no one can see it.
Even when it would not have such parasitic name, many seasoned Go programmers, me included, consider the self-proclaimed "Standard Go project Layout" as the opposite of what is good and advisable.
Unfortunately, the name just works, so it is being recommended all over the Internet since its inception.
-
"14 Years of Go" by Rob Pike
Your comment makes it look as if you're saying you hate the Go development team, but it seems that isn't the case.
I get a little of what you're saying, I wouldn't say I hate anyone, but I strongly dislike how a lot of projects are organized. I think a lot stems from https://github.com/golang-standards/project-layout , which pretended to be standard and was so (ab)used one of the creators opened an issue about it. If you look at the actual Go src, it's much, much cleaner.
-
Looking for elegant code bases written in GoLang
So you don't get blind sided for self proclaimed "standards" that are not
- I'm coming from Java and I have been told that I'm writing go like I'm writing Java. Basically creating structs, injecting fields, and attaching methods. What else can I do?
- O poder do CLI com Golang e Cobra CLI
- Como deixar o Swagger com tema dark mode usando Swaggo e Golang
-
Can I point a module to a subdirectory?
I am writing a project that has two components: a CLI and a library. I've organised the project as follows (as per organisation instructions):
-
How To Build A Containerized Microservice in Golang: A Step-by-step Guide with Example Use-Case
Familiarity with the standard Golang project structure, which you can find here.
-
Building RESTful API with Hexagonal Architecture in Go
I've been learning how to build web applications using different frameworks and languages for a while now, such as Laravel with its MVC architecture and Node.js following the 'Hapi.js Way'. As I'm trying to create a new portfolio project using Go, I found myself contemplating over the ideal project structure. I wanted something that not only aligns with the standard Go project layout, but also makes the code both easy to write and understand. That's when I stumbled upon the concept of Hexagonal Architecture, as showcased in Netflix's engineering blog. The idea of seamlessly swapping infrastructures with minimal code changes fascinated me, and I decided to implement it in my new project.