1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

deps: middleware add separate go.mod and removes framework deps (#1385)

* deps: middleware add separate go.mod and removes framework deps
This commit is contained in:
包子
2021-08-30 23:07:31 +08:00
committed by GitHub
parent c55528f321
commit 7b6332ee75
57 changed files with 1081 additions and 1932 deletions
+9 -4
View File
@@ -4,8 +4,7 @@ import (
"testing"
"github.com/go-kratos/kratos/v2/encoding"
"github.com/go-kratos/kratos/v2/internal/testproto/complex"
testproto "github.com/go-kratos/kratos/v2/internal/testproto/encoding"
"github.com/go-kratos/kratos/v2/internal/complex"
"github.com/stretchr/testify/require"
)
@@ -14,6 +13,11 @@ type LoginRequest struct {
Password string `json:"password,omitempty"`
}
type TestModel struct {
ID int32 `json:"id"`
Name string `json:"name"`
}
const contentType = "x-www-form-urlencoded"
func TestFormCodecMarshal(t *testing.T) {
@@ -33,11 +37,12 @@ func TestFormCodecMarshal(t *testing.T) {
require.NoError(t, err)
require.Equal(t, []byte("username=kratos"), content)
m := testproto.TestModel{
Id: 1,
m := TestModel{
ID: 1,
Name: "kratos",
}
content, err = encoding.GetCodec(contentType).Marshal(m)
t.Log(string(content))
require.NoError(t, err)
require.Equal(t, []byte("id=1&name=kratos"), content)
}