News for hackers. Stuff that matters.
Re:Erlang and code style by signa11 on Tuesday May 20, 2014 @11:54PM (#7776616)
if _, err := os.Open("file.go"); err != nil {

      //handle error

    }

    // Do stuff with file

but you need to split that into 2 lines, just like the good article says i.e.

   file, err := os.Open("abcd")

   if err != nil {

      // <handle os.Open(...) errors

   }
otherwise, outside the 'if {...}' block, 'file' is undefined.

There are no comments on this comment yet.