Settings

Theme

What's your go to literature to build Go libraries?

2 points by Halan 2 years ago · 2 comments · 1 min read

Reader

Any blog post or pages you would recommend to somebody writing their first Go libraries?

I am thinking things like UX and best practices

0xjnml 2 years ago

> 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.

petercooper 2 years ago

To be honest, the best method is to find good Go libraries and do some code reading. Not every project will be using best practices, even those created by prominent Go developers, but if you read through several libraries, you'll pick things up by osmosis.

That said, https://go.dev/doc/modules/layout and https://github.com/golang-standards/project-layout may help.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection