我有一個包和許多測試文件。web |- client.go |- client_test.go |- server.go |- server_test.go |- ...如果我想運行go test client_test.go,它會為我報告錯誤。package web // not the package name web_testfunc TestHost(t *testing.T) { hostPort, hostNoPort := hostPortNoPort()}// error: undefined hostPortNoPort// But this function actually defined in the client.go
如何在沒有 _test 的情況下進行測試
慕婉清6462132
2022-06-01 11:16:42