@danhab99@programming.dev to Golang@programming.devEnglish • 9 months agoI kinda wish there was a better way to do if err != nil in gogithub.comexternal-linkmessage-square10fedilinkarrow-up111arrow-down16file-text
arrow-up15arrow-down1external-linkI kinda wish there was a better way to do if err != nil in gogithub.com@danhab99@programming.dev to Golang@programming.devEnglish • 9 months agomessage-square10fedilinkfile-text
minus-square@danhab99@programming.devOPlinkfedilink2•9 months ago As an aside, you probably don’t need a static union type for your min and max functions. I assume you could use comparable. comparible only allows ==
minus-square@theherk@lemmy.worldlinkfedilink2•9 months agoOh right! What am I saying? contraints.Ordered maybe.
minus-square@danhab99@programming.devOPlinkfedilink1•9 months agoI just looked at the standard docs and I didn’t realize there was a built-in min and max function. Y’all should really read the standard lib docs… it’s fascinating in there.
comparible
only allows==
Oh right! What am I saying?
contraints.Ordered
maybe.I just looked at the standard docs and I didn’t realize there was a built-in min and max function. Y’all should really read the standard lib docs… it’s fascinating in there.