late-to-the-party-Googlers: be advised of the os.IsNotExist function.
http://godoc.org/os#IsNotExist
Greetings,
Hraban
Τη Τρίτη, 18 Οκτωβρίου 2011 8:27:56 μ.μ. UTC+3, ο χρήστης chris dollin
έγραψε:
On 18 October 2011 18:21, Nathan Trimble wrote:
Oh interesting. Excuse the ignorance please, but could someone explain the
line below to me?
e, ok := err.(*os.PathError);
err is an os.Error type correct? So what is "err.(*os.PathError)" doing?
It's a type assertion. If err is of actual type *os.PathError, assign theOh interesting. Excuse the ignorance please, but could someone explain the
line below to me?
e, ok := err.(*os.PathError);
err is an os.Error type correct? So what is "err.(*os.PathError)" doing?
value to (a probably freshly declared) e (which will/should have type
*os.PathError) and true to ok; otherwise assign false to ok and
a zero value to e.
Note that os.Error is an interface type.
Chris
--
Chris "allusive" Dollin