在待测试的私有函数所在的包内,新建一个xx_test.go文件,书写方式如下:
import (
"github.com/stretchr/testify/assert"
"testing"
)
var XXFunc = yourPrivateFunc
func TestXXFunc(t *testing.T) {
ret, ... := XXFunc(
在待测试的私有函数所在的包内,新建一个xx_test.go文件,书写方式如下:
import (
"github.com/stretchr/testify/assert"
"testing"
)
var XXFunc = yourPrivateFunc
func TestXXFunc(t *testing.T) {
ret, ... := XXFunc(