go 单元测试使用assert
package test
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSomething(t *testing.T) {
a := "a"
b := "b"
// a是expected
// b是actual
assert.Equal(t, a, b, "not equal")
}
文件名以_test结尾。
函数名以Test开头,后续字母开头时首字母大写。