go assert equal 的使用
https://pkg.go.dev/github.com/stretchr/testify/assert
如果结果和预期结果不同,那么会返回err, 并显示两个结果的区别
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSomething(t *testing.T) {
var a string = "Hello"
var b string = "Hello"
assert.Equal(t, a, b, "The two words should be the same.")
}