使用github actions 建立CI/CD
- repo點擊actions並選擇go套版
- 他會在
.github/
底下的workflows/
放上你的 workflow yaml 檔案
Unit Test
https://quii.gitbook.io/learn-go-with-tests/
Go內建test套件,先建一個hello_test.go的檔案,然後放入程式碼看看
package main
import "testing"
func TestHello(t *testing.T) {
t.Log("hello world")
}
func TestWorld(t *testing.T) {
t.Error("world of bug")
}