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
I have a situation where I'm not able to copy unexported struct type values to the exported base fields.
package main
import ( "fmt"
"github.com/jinzhu/copier"
)
func main() { type common struct { Common1 int json:"Common1" Common2 string json:"Common2" }
json:"Common1"
json:"Common2"
type source struct { Name string `json:"Name"` Description string `json:"Description"` common } type destination struct { Name string `json:"Name"` Description string `json:"Description"` Common1 int `json:"Common1"` Common2 string `json:"Common2"` } src := source{Name: "name", Description: "description", common: common{Common1: 2, Common2: "common2"}} dest := destination{} copier.Copy(&dest, src) fmt.Printf("values %v", dest)
}
Actual : values {name description 0 }
Expected Please advise me on how to get the output as values {name description 2 common2}
The text was updated successfully, but these errors were encountered:
jinzhu
No branches or pull requests
I have a situation where I'm not able to copy unexported struct type values to the exported base fields.
package main
import (
"fmt"
)
func main() {
type common struct {
Common1 int
json:"Common1"
Common2 string
json:"Common2"
}
}
Actual : values {name description 0 }
Expected
Please advise me on how to get the output as values {name description 2 common2}
The text was updated successfully, but these errors were encountered: