1
0
mirror of https://github.com/golang/go synced 2024-11-06 01:56:12 -07:00
go/refactor/eg/testdata/I.template
Colin 2226533658 refactor/eg: Add support for multi line after statements to eg.
The semantics of this change are that the last line will be subsituted
in place of the expression, where as the lines before that will undergo
variable substitution and be prepended before the lowest (in the AST
tree sense) statement which included the expression.

Change-Id: Ie2571934dcc1b0a30b5cec157e690924a4ac2c5a
Reviewed-on: https://go-review.googlesource.com/77730
Reviewed-by: Alan Donovan <adonovan@google.com>
2018-03-19 17:51:41 +00:00

15 lines
213 B
Plaintext

// +build ignore
package templates
import (
"errors"
"fmt"
)
func before(s string) error { return fmt.Errorf("%s", s) }
func after(s string) error {
n := fmt.Sprintf("error - %s", s)
return errors.New(n)
}