This commit is contained in:
86150 2021-08-22 15:00:32 +08:00
parent 6abf4255d7
commit f8f653c6f9
3 changed files with 17 additions and 0 deletions

1
go.mod
View File

@ -5,4 +5,5 @@ go 1.16
require (
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
)

5
pkg/middle/test/Hello.go Normal file
View File

@ -0,0 +1,5 @@
package test
func Hello(str string) (bool, error) {
return str == "Nice", nil
}

View File

@ -0,0 +1,11 @@
package test
import (
"github.com/stretchr/testify/require"
"testing"
)
func TestHello(t *testing.T) {
_, err := Hello("Nice")
require.NoError(t, err)
}