go unit test assert 的使用
https://github.com/stretchr/testify
https://pkg.go.dev/github.com/stretchr/testify/assert
https://darjun.github.io/2021/08/11/godailylib/testify/
1.安装
go get github.com/stretchr/testify
2. 引入
package yours
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSomething(t *testing.T) {
assert.True(t, true, "True is true!")
}3.测试
go test