this post was submitted on 02 Mar 2025
8 points (100.0% liked)
Golang
2321 readers
3 users here now
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I haven't written go in a little while, so things may have a changed since. I'll give this a go regardless.
First thing I notice is there's no explanation of what this is supposed to do. A little blurb in the readme would help. I have no idea what rbac is, so it would give me some context.
Then, there's no main function. Where's the entry point? This is a bit where I'm doubting myself now. Maybe go has changed, but when I was writing it, it requires a main function to even run.
I also notice that many of your functions and types start with a capital letter, making them public, but everything is in the same package. This is maybe nitpicky, but I would start with everything as private. As the project grows, and things get organised in packages, you open up the things you need.
With all that said, if it runs and does what you expect it to, I'd say that looks good!
Since it has no main, I guess it's not an executable but meant as a library, which also explains the exports, as a third party should be able to consume the library
That's a bingo! Yeah I decided to dip my toes into Go by writing a simple library on a topic I was learning about