// Then method invokes callback function only if current optional is empty
// This can be used for method chaining:
//
// optional.OfError(nil).Then(...).Then(...).Then(...).Panic()
Then method invokes callback function only if current optional is empty
This can be used for method chaining.


// Then method invokes callback function only if current optional is empty // This can be used for method chaining : // // optional . OfError ( nil ) . Then ( ... ) . Then ( ... ) . Then ( ... ) . Panic ()
func (e Error) Then(f func() error) Error {
	if e.IsPresent() || f == nil {
		return e
	}
	return OfError(f())
}
func ( e Error ) Then ( f func ( ) error ) Error { if e . IsPresent ( ) || f == nil { return e } return OfError ( f ( ) ) }
Then method invokes callback function only if current optional is empty
This can be used for method chaining.
Then method invokes callback function only if current optional is empty This can be used for method chaining .