Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zedisdog
Copy link

@zedisdog zedisdog commented Apr 23, 2024

type struct1 struct {
    A int
}

type struct2 struct {
    A int
}

s1 := struct1{A: 1}
var s2 *struct2

err := copier.Copy(&s2, s1)
if err != nil {
    t.Error("should not error")
}
if s1.A != (*s2).A {
    t.Error("should equal")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant