增加基于tap设备的桥接访问模式

This commit is contained in:
bjdgyc
2020-09-14 17:17:50 +08:00
parent 3b64de19b8
commit 31b1f12dbe
57 changed files with 2598 additions and 703 deletions

View File

@@ -0,0 +1,38 @@
package sessdata
import (
"testing"
"github.com/stretchr/testify/assert"
)
type A struct {
Id int
Name string
Age int
Addr string
}
type B struct {
IdB int
NameB string
Age int
Addr string
}
func TestCopyStruct(t *testing.T) {
assert := assert.New(t)
a := A{
Id: 1,
Name: "bob",
Age: 15,
Addr: "American",
}
b := B{}
err := CopyStruct(&b, a)
assert.Nil(err)
assert.Equal(b.IdB, 0)
assert.Equal(b.NameB, "")
assert.Equal(b.Age, 15)
assert.Equal(b.Addr, "American")
}