使用Go Test測試單個文件和單個方法

前置條件:函數 一、文件名須以"_test.go"結尾測試 二、方法名須以"Test"打頭,而且形參爲 (t *testing.T)code 舉例:/hello_test.goclass package main import ( "testing" "fmt" ) func TestHello(t *testing.T) { fmt.Println("TestHello") } fu
相關文章
相關標籤/搜索