We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code `package main
import ( "fmt" "github.com/jinzhu/copier" )
type baseUser struct { Id int Name string }
type User struct { baseUser Name string }
type Employee struct { baseUser // Tell copier.Copy to panic if this field is not copied. Name string copier:"must" }
copier:"must"
func main() { b := baseUser{Id: 11} var ( user = User{baseUser: b, Name: "Jinzhu"} employee = Employee{Name: "zzz"} )
copier.Copy(&employee, &user) fmt.Printf("%#v \n", employee)
} `
0.3.4 nested struct, struct starts with lowercase, cannot copy
version:0.3.4 output: main.Employee{baseUser:main.baseUser{Id:0, Name:""}, Name:"Jinzhu"}
output: main.Employee{baseUser:main.baseUser{Id:0, Name:""}, Name:"Jinzhu"}
version:0.3.2 output: main.Employee{baseUser:main.baseUser{Id:11, Name:""}, Name:"Jinzhu"}
output: main.Employee{baseUser:main.baseUser{Id:11, Name:""}, Name:"Jinzhu"}
The text was updated successfully, but these errors were encountered:
jinzhu
No branches or pull requests
Reproducible Example
code
`package main
import (
"fmt"
"github.com/jinzhu/copier"
)
type baseUser struct {
Id int
Name string
}
type User struct {
baseUser
Name string
}
type Employee struct {
baseUser
// Tell copier.Copy to panic if this field is not copied.
Name string
copier:"must"
}
func main() {
b := baseUser{Id: 11}
var (
user = User{baseUser: b, Name: "Jinzhu"}
employee = Employee{Name: "zzz"}
)
}
`
Description
0.3.4 nested struct, struct starts with lowercase, cannot copy
version:0.3.4
output: main.Employee{baseUser:main.baseUser{Id:0, Name:""}, Name:"Jinzhu"}
version:0.3.2
output: main.Employee{baseUser:main.baseUser{Id:11, Name:""}, Name:"Jinzhu"}
The text was updated successfully, but these errors were encountered: