summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt
blob: c715dd234f70ed8f18001d04c5829d55fe7956a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Module with a function that prints file name for the top stack frame.
Different versions of this module are identical, but they should return
different file names with -trimpath.
-- .mod --
module example.com/stack

go 1.14
-- .info --
{"Version":"v1.0.1"}
-- stack.go --
package stack

import "runtime"

func TopFile() string {
	_, file, _, _ := runtime.Caller(0)
	return file
}