https://github.com/golang/net/blob/master/icmp/diag_test.go
我看到这样的测试文件。我想在 go 包之外运行它。有没有一种方法可以自动将 go 文件转换为一种形式,以便它可以go run在包外部运行?
编辑:Is it possible to call a test Func from another file to start the testing太复杂了。对于这个问题,答案是肯定的和否定的。因此,不应将其视为重复。
https://github.com/golang/net/blob/master/icmp/diag_test.go
我看到这样的测试文件。我想在 go 包之外运行它。有没有一种方法可以自动将 go 文件转换为一种形式,以便它可以go run在包外部运行?
编辑:Is it possible to call a test Func from another file to start the testing太复杂了。对于这个问题,答案是肯定的和否定的。因此,不应将其视为重复。