package test import ( "fmt" "git.tsl3060.com/openapi/go-security/jwt" "testing" ) func Test_Jwt(t *testing.T) { t.Run("test jwt", func(t *testing.T) { // 设置公钥 service, err := jwt.NewTokenService("public key") if err != nil { return } // 校验解析token token, err := service.VerifyToken("token") if err != nil { return } fmt.Println(token) }) }