💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
# 引用 (1)引用go的标准包:testing (2)引用第三方的assert包 ~~~ import ( "testing" "github.com/stretchr/testify/assert" ) ~~~ # 例子 ![](https://img.kancloud.cn/e1/39/e1390801142ba1e6673246602fd01b19_1587x907.png) 测试函数: ~~~ funcTestNewMerkleTree(t *testing.T) ~~~ 断言: ~~~ assert.Equal(t, rootHash, fmt.Sprintf("%x", mTree.RootNode.Data), "Merkle tree root hash is correct") ~~~ # 其他断言 ~~~ NotEqual ~~~ ~~~ Nil ~~~ ~~~ NotNil ~~~