func functionCloser(original func() error, additionalCloser func() error) {
	original = func() (newErr error) {
		err := original()
		newErr = additionalCloser()
		if err != nil {
			if newErr != nil {
				newErr = fmt.Errorf("Two errors: error when calling original function: %s\nOriginal errors: %s", err, newErr)
				return
			}
			err = fmt.Errorf("One original error: %s", err)
			return
		}
		if newErr != nil {
			newErr = fmt.Errorf("New error after calling additional closer: \n%s", newErr)
			return
		}
		return
	}
	return
}
// functionCloser modifies the original function to add another one on to its stack. Uses function pointers. Honestly just having fun here to see what compiles, might not even work. This is the most impure thing I've ever written.
functionCloser modifies the original function to add another one on to its stack. Uses function pointers. Honestly just having fun here to see what compiles, might not even work. This is the most impure thing I've ever written.
// functionCloser modifies the original function to add another one on to its stack . Uses function pointers . Honestly just having fun here to see what compiles might not even work . This is the most impure thing I ' ve ever written .
func functionCloser(original func() error, additionalCloser func() error) {
	original = func() (newErr error) {
		err := original()
		newErr = additionalCloser()
		if err != nil {
			if newErr != nil {
				newErr = fmt.Errorf("Two errors: error when calling original function: %s\nOriginal errors: %s", err, newErr)
				return
			}
			err = fmt.Errorf("One original error: %s", err)
			return
		}
		if newErr != nil {
			newErr = fmt.Errorf("New error after calling additional closer: \n%s", newErr)
			return
		}
		return
	}
	return
}
func functionCloser ( original func ( ) error , additionalCloser func ( ) error ) { original = func ( ) ( newErr error ) { err := original ( ) newErr = additionalCloser ( ) if err != nil { if newErr != nil { newErr = fmt . Errorf ( " \n " , err , newErr ) return } err = fmt . Errorf ( " " , err ) return } if newErr != nil { newErr = fmt . Errorf ( " \n " , newErr ) return } return } return }
functionCloser modifies the original function to add another one on to its stack.
functionCloser modifies the original function to add another one on to its stack .