Did I break a taboo by doing this?

    • danhab99@programming.dev
      hexagon
      ·
      edit-2
      1 year ago

      Oh yeah and it's also less to type. Good idea!

      Edit: here's the change https://github.com/danhab99/idk/blob/main/idk.go#L13

  • ck_@discuss.tchncs.de
    ·
    1 year ago

    I would call it a taboo because it diverges from the general best practice. That makes your code harder to read and understand for people less familiar with "your style". Given that code is read much more often that it is written, you are optimizing on the wrong end.

  • dbx12@programming.dev
    ·
    1 year ago

    I too consider that if err != nil a bit complicated to type. Most times, I wrap it away in a function like your Check0. I know that the major "framework" for command line applications (cobra) has a similar logic with its checkError function.