DEV Community

Discussion on: Let's write config for your Golang web app on right way — YAML 👌

koddr profile image
Vic Shóstak Author • Edited on

Didn't really understand, when init() became an anti-pattern for the Go community? Give me a link to an article about it, please. Same thing about "global variables".

Maybe you should write the right article about how to make a Go web app config in the right format? I'd read it, really.

Feel free to ignore me though lol, just my $0.02.

I don't have the slightest idea what you're talking about here. Explain, please. I haven't even met you to ignore you. 🤷‍♂️

j4ng5y profile image
Jordan Gregory

Rather than duplicating the work, I'll just give you an MR on your repo with reference :)

As far as ignoring me, I'm opinionated, so it comes with the territory lol.

Thread Thread
koddr profile image
Vic Shóstak Author • Edited on

Oh, that's would be nice! Thx 😉

But, actually, when init() become an "anti-pattern"? Because I see init() on many online books, courses and articles by Go bloggers.

I googled it, but I couldn't find any confirmation of your words.

Even the other way around! For example, "Effective Go" book on official Golang website: