%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/go/src/cmd/go/testdata/script/
Upload File :
Create Path :
Current File : //usr/local/go/src/cmd/go/testdata/script/test_trimpath_main.txt

[short] skip

go test -trimpath -v .
! stdout '[/\\]pkg_test[/\\]'
stdout -count=2 '[/\\]pkg[/\\]'

-- go.mod --
module example.com/pkg

go 1.17

-- main.go --
package main

import "runtime"

func PrintFile() {
	_, file, _, _ := runtime.Caller(0)
	println(file)
}

-- main_test.go --
package main

import (
	"runtime"
	"testing"
)

func PrintFileForTest() {
	_, file, _, _ := runtime.Caller(0)
	println(file)
}

func TestMain(m *testing.M) {
	PrintFile()
	PrintFileForTest()
}

Zerion Mini Shell 1.0