README ¶ vincentinttsh/replace replace struct value by another struct package main import ( "fmt" "github.com/vincentinttsh/replace" ) func main() { var data1 struct { Name string UserName string Email string Password string } data1.Name = "user" data1.UserName = "user" data1.Email = "user" data1.Password = "password" var data2 struct { Name *string UserName *string Email *string Password *string } value := "newuser" data2.Name = &value fmt.Println(data1) replace.replace(&data1, &data2) fmt.Println(data1) } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func Replace(old, new interface{}) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Replace ¶ func Replace(old, new interface{}) Replace replace struct value by another struct Types ¶ This section is empty. Source Files ¶ View all Source files replace.go Click to show internal directories. Click to hide internal directories.