Skip to content
New issue

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

Overwrite function does not support repeated Message fields #9

Closed
geoffwatson opened this issue Mar 13, 2024 · 5 comments · Fixed by #10
Closed

Overwrite function does not support repeated Message fields #9

geoffwatson opened this issue Mar 13, 2024 · 5 comments · Fixed by #10

Comments

@geoffwatson
Copy link
Contributor

Added to the testOverwrite function will panic.

{
			name:  "overwrite repeated message fields",
			paths: []string{"gallery.path"},
			src: &testproto.Profile{
				User: &testproto.User{
					UserId: 567,
					Name:   "different-name",
				},
				Photo: &testproto.Photo{
					Path: "photo-path",
				},
				LoginTimestamps: []int64{1, 2, 3},
				Attributes: map[string]*testproto.Attribute{
					"src": {},
				},
				Gallery: []*testproto.Photo{
					{
						PhotoId: 123,
						Path:    "test-path-1",
						Dimensions: &testproto.Dimensions{
							Width:  345,
							Height: 456,
						},
					},
					{
						PhotoId: 234,
						Path:    "test-path-2",
						Dimensions: &testproto.Dimensions{
							Width:  3456,
							Height: 4567,
						},
					},
					{
						PhotoId: 345,
						Path:    "test-path-3",
						Dimensions: &testproto.Dimensions{
							Width:  34567,
							Height: 45678,
						},
					},
				},
			},
			dest: &testproto.Profile{
				User: &testproto.User{
					Name: "name",
				},
				Gallery: []*testproto.Photo{
					{
						PhotoId: 123,
						Path:    "test-path-7",
						Dimensions: &testproto.Dimensions{
							Width:  345,
							Height: 456,
						},
					},
					{
						PhotoId: 234,
						Path:    "test-path-6",
						Dimensions: &testproto.Dimensions{
							Width:  3456,
							Height: 4567,
						},
					},
					{
						PhotoId: 345,
						Path:    "test-path-5",
						Dimensions: &testproto.Dimensions{
							Width:  34567,
							Height: 45678,
						},
					},
					{
						PhotoId: 345,
						Path:    "test-path-4",
						Dimensions: &testproto.Dimensions{
							Width:  34567,
							Height: 45678,
						},
					},
				},
			},
			want: &testproto.Profile{
				User: &testproto.User{
					Name: "name",
				},
				Gallery: []*testproto.Photo{
					{
						PhotoId: 123,
						Path:    "test-path-1",
						Dimensions: &testproto.Dimensions{
							Width:  345,
							Height: 456,
						},
					},
					{
						PhotoId: 234,
						Path:    "test-path-2",
						Dimensions: &testproto.Dimensions{
							Width:  3456,
							Height: 4567,
						},
					},
					{
						PhotoId: 345,
						Path:    "test-path-3",
						Dimensions: &testproto.Dimensions{
							Width:  34567,
							Height: 45678,
						},
					},
				},
			},
		},
@geoffwatson
Copy link
Contributor Author

I have a fix for this, but do not have permissions to push it.

@mennanov
Copy link
Owner

@geoffwatson could you please create a pull request with a fix?

@geoffwatson
Copy link
Contributor Author

ERROR: Permission to mennanov/fmutils.git denied to geoffwatson.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@mennanov
Copy link
Owner

Hm.. try forking the repository first and then open a pull request: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo

@geoffwatson
Copy link
Contributor Author

Sorry for the delay. #10

@mennanov mennanov linked a pull request Mar 19, 2024 that will close this issue
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 a pull request may close this issue.

2 participants