As I came from python background following go code is very confusing for me. can some one explain this?
if nferr, ok := err.(ops.NonFatalError); ok {
w.NonFatalDiagnostics = w.NonFatalDiagnostics.Append(nferr.Diagnostics)
return nil
}
- how the variables nferr, ok would be evaluated?
what is the variable
okbefore opening curly brace?statement
return nil, does it return from the function, the code is in?