Files
EdgeCommon/pkg/configutils/copy_test.go

30 lines
441 B
Go
Raw Permalink Normal View History

2020-09-13 19:27:47 +08:00
package configutils
import (
"testing"
2024-07-27 13:29:26 +08:00
"github.com/iwind/TeaGo/logs"
2020-09-13 19:27:47 +08:00
)
func TestCopyStructObject(t *testing.T) {
type Book struct {
Name string
Price int
Year int
Author string
press string
}
book1 := &Book{
Name: "Hello Golang",
Price: 100,
Year: 2020,
Author: "Liu",
press: "Beijing",
}
book2 := new(Book)
CopyStructObject(book2, book1)
logs.PrintAsJSON(book2, t)
logs.PrintAsJSON(book1, t)
}