Panpito

27 posts

Panpito banner
Panpito

Panpito

@Panpit0

Teaching Go on YouTube!

London Bergabung Ocak 2023
10 Mengikuti20 Pengikut
Panpito me-retweet
Raspberry Pi Foundation
Raspberry Pi Foundation@RaspberryPi_org·
10K FOLLOWER GIVEAWAY 🎉🎈🎁 To celebrate 10K followers on Twitter, we're giving away 3x Raspberry Pi Foundation tote bags containing Raspberry Pi branded goodies 😍 Winners will be randomly selected on Friday, 19 May 2023. To enter: Follow us, like & RT this tweet. Good luck!
Raspberry Pi Foundation tweet media
English
656
10.2K
13.5K
1.2M
Panpito
Panpito@Panpit0·
@thinkverse Ah, I didn't express myself very well. For your initial question, yes I would go with var/init. That's what I was trying to suggest to have a neat init function.
Panpito tweet media
English
0
0
1
20
Kim
Kim@thinkverse·
@Panpit0 Effective Go suggests using init to verify or repair the correctness of the program state before execution. So I don't see how wrapping it in a function with make it neater in this case if init is used for that purpose already?
English
1
0
0
94
Kim
Kim@thinkverse·
OK #golang experts, question. When allowing changing ports using env variables, which pattern makes more sense? Reading Effective Go. var and init seem better, but most of the real-world examples I've seen keeps it in the main. 🤔 Is there any consensus on what to use? 🙂
Kim tweet mediaKim tweet media
English
2
0
2
293