/** * \brief Retrieve a diagnostic associated with the given translation unit. * * \param Unit the translation unit to query. * \param Index the zero-based diagnostic number to retrieve. * * \returns the requested diagnostic. This diagnostic must be freed * via a call to \c clang_disposeDiagnostic(). */ func (tu TranslationUnit) Diagnostics() (ret Diagnostics) { ret = make(Diagnostics, C.clang_getNumDiagnostics(tu.c)) for i := range ret { ret[i].c = C.clang_getDiagnostic(tu.c, C.uint(i)) } return }
/* Retrieve a diagnostic associated with the given translation unit. Parameter Unit the translation unit to query. Parameter Index the zero-based diagnostic number to retrieve. Returns the requested diagnostic. This diagnostic must be freed via a call to clang_disposeDiagnostic(). */ func (tu TranslationUnit) Diagnostic(index uint32) Diagnostic { return Diagnostic{C.clang_getDiagnostic(tu.c, C.uint(index))} }