...

Text file src/cmd/go/testdata/mod/example.com_stack_v1.0.1.txt

Documentation: cmd/go/testdata/mod

     1Module with a function that prints file name for the top stack frame.
     2Different versions of this module are identical, but they should return
     3different file names with -trimpath.
     4-- .mod --
     5module example.com/stack
     6
     7go 1.14
     8-- .info --
     9{"Version":"v1.0.1"}
    10-- stack.go --
    11package stack
    12
    13import "runtime"
    14
    15func TopFile() string {
    16	_, file, _, _ := runtime.Caller(0)
    17	return file
    18}

View as plain text