I'm using runtime.Caller(0)
to return the file name:
_, file, _, ok := runtime.Caller(0)
if !ok {
// What should I do here?
}
I would like to know:
- Why this function in specific doesn't provide an error?
- What should I do if it fails? (Panic, fatal error?)
- What could be wrong to fail? Should I validate at all?
This is my first week using Go, so I might seem like stupid questions if you are already advanced, and I'm sorry for that.
Thanks in advance.