User talk:PureFox: Difference between revisions

Content added Content deleted
Line 61: Line 61:


:: Yes, I'll update my correction.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:22, 19 September 2017 (UTC)
:: Yes, I'll update my correction.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:22, 19 September 2017 (UTC)

== Go solutions: panic, gofmt ==

I see you've added a number of missing Go solutions recently which is excellent.

I have however noticed you have tendency to use <code>panic</code> for error reporting
which is a bad practice in Go and should be avoided in examples IMO.
At a minimum I'd suggest using <code>log.Fatal</code> in future examples, and ideally that would only appear in the main function,
other functions returning an <code>error</code> value as is idiomatic in Go.
(Of course,
[https://golang.org/doc/effective_go.html#panic idiomatic uses of panic],
such as when detecting unrecoverable programming errors, are quite reasonable.)

Also, when I work on Go solutions here I tend to just copy-paste between my editor and Rosetta's edit web form which preserves the "standard" Go formatting of
<code>[https://golang.org/doc/effective_go.html#formatting gofmt]</code>
(actually <code>goimports</code> for me).
I noticed your code uses four space indenting instead of gofmt's tabs==eight spaces
which causes your Go solutions to look different from the majority of Go code on this site and elsewhere.

Just a little nitpicking :) &mdash;[[User:dchapes|dchapes]] ([[User talk:dchapes|talk]] | [[Special:Contributions/dchapes|contribs]]) 18:57, 20 June 2018 (UTC)