mirror of
https://github.com/golang/go
synced 2024-11-26 18:26:48 -07:00
cmd/compile: rename init function from init.ializers back to init
The name change init -> init.ializers was initially required for initialization code. With CL 161337 there's no wrapper code any more, there's a data structure instead (named .inittask). So we can go back to just plain init appearing in tracebacks. RELNOTE=yes Update #29919. Followon to CL 161337. Change-Id: I5a4a49d286df24b53b2baa193dfda482f3ea82a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/167780 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
27e444d5e6
commit
7b916243d9
@ -46,7 +46,7 @@ func fninit(n []*Node) {
|
||||
// Make a function that contains all the initialization statements.
|
||||
if len(nf) > 0 {
|
||||
lineno = nf[0].Pos // prolog/epilog gets line number of first init stmt
|
||||
initializers := lookup("init.ializers")
|
||||
initializers := lookup("init")
|
||||
disableExport(initializers)
|
||||
fn := dclfunc(initializers, nod(OTFUNC, nil, nil))
|
||||
for _, dcl := range dummyInitFn.Func.Dcl {
|
||||
|
@ -157,7 +157,7 @@ func TestErrorFormatter(t *testing.T) {
|
||||
want: "fallback:" +
|
||||
"\n somefile.go:123" +
|
||||
"\n - file does not exist:" +
|
||||
"\n os.init.ializers" +
|
||||
"\n os.init" +
|
||||
"\n .+/os/error.go:\\d\\d",
|
||||
regexp: true,
|
||||
}, {
|
||||
|
@ -34,8 +34,8 @@ func f() int {
|
||||
if !strings.Contains(s, "a.go:19") {
|
||||
panic("missing a.go:19")
|
||||
}
|
||||
if !strings.Contains(s, "a.init.ializers") {
|
||||
panic("missing a.init.ializers")
|
||||
if !strings.Contains(s, "a.init") {
|
||||
panic("missing a.init")
|
||||
}
|
||||
|
||||
// Check the CallersFrames results.
|
||||
@ -58,11 +58,11 @@ func f() int {
|
||||
panic("traceback truncated after f")
|
||||
}
|
||||
f, more = iter.Next()
|
||||
if f.Function != "a.init.ializers" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 {
|
||||
panic(fmt.Sprintf("bad init.ializers %v\n", f))
|
||||
if f.Function != "a.init" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 {
|
||||
panic(fmt.Sprintf("bad init %v\n", f))
|
||||
}
|
||||
if !more {
|
||||
panic("traceback truncated after init.ializers")
|
||||
panic("traceback truncated after init")
|
||||
}
|
||||
f, _ = iter.Next()
|
||||
if !strings.HasPrefix(f.Function, "runtime.") {
|
||||
|
Loading…
Reference in New Issue
Block a user