MCPcopy
hub / github.com/gin-gonic/gin / Last

Method Last

errors.go:116–121  ·  view source on GitHub ↗

Last returns the last error in the slice. It returns nil if the array is empty. Shortcut for errors[len(errors)-1].

()

Source from the content-addressed store, hash-verified

114// Last returns the last error in the slice. It returns nil if the array is empty.
115// Shortcut for errors[len(errors)-1].
116func (a errorMsgs) Last() *Error {
117 if length := len(a); length > 0 {
118 return a[length-1]
119 }
120 return nil
121}
122
123// Errors returns an array with all the error messages.
124// Example:

Callers 7

TestErrorSliceFunction · 0.95
JSONMethod · 0.95
TestContextHandlersFunction · 0.45
TestContextErrorFunction · 0.45
debugPrintRouteFunction · 0.45
HandlerNameMethod · 0.45
HandlerMethod · 0.45

Calls

no outgoing calls

Tested by 3

TestErrorSliceFunction · 0.76
TestContextHandlersFunction · 0.36
TestContextErrorFunction · 0.36