Hi,
I'm used to doing error handling like the following:

  out, err := os.Create(potential_file_name)
  switch t := err.(type) {
  case *os.PathError:
    switch t.Err {
    case os.ErrNotExist:
 etc...

However I came a cropper with an error that I traced to coming out of 
syscall - specifically:
syscall/zerrors_linux_arm.go

Where the error code back from the os is translated into just a text 
string. This makes it an annoying error to test for as it has no type, just 
a string to process. I believe this is against the intended method of go 
error handling.
Or am i missing something basic here? Is there a clever way I am missing to 
check for which of these low level errors it is without parsing a text 
string (Which feels very retro)?

Regards

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to