You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
280 B

package main
import (
"dsBaseRpc/Utils/CommonUtil"
"fmt"
)
type S1 struct {
Name string
Age int
}
type S2 struct {
Name string
Age int
Sex int
}
func main() {
var target S1
source := S2{"world", 33, 0}
CommonUtil.CopyFields(source,&target)
fmt.Println(target)
}