在Go中,文件名具有語義含義。例如:轉到特定操作系統或體系結構的測試文件
*_windows.go // Only include in compilations for Windows
*_unix.go // Only include in compilations for Unix
*_386.go // Only include in compilations for 386 systems
*_test.go // Only include when run with `go test`
不過,我似乎無法得到以下工作:
*_windows_test.go // Only include when running `go test` on windows
*_test_windows.go // Another attempt
這甚至可能一起去?如果是這樣,怎麼樣?
是的,我擔心我可能必須這麼做......哦。 – joshlf 2015-02-07 21:50:54