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

Panics with list of objects #2

Open
DBL-Lee opened this issue Jan 20, 2021 · 0 comments · May be fixed by #4
Open

Panics with list of objects #2

DBL-Lee opened this issue Jan 20, 2021 · 0 comments · May be fixed by #4

Comments

@DBL-Lee
Copy link

DBL-Lee commented Jan 20, 2021

I was able to reproduce with following minimal code:

package main

import (
	"encoding/json"

	"github.com/herkyl/patchwerk"
)

type Foo struct {
	Name string
}

func main() {
	from, _ := json.Marshal([]Foo{
		Foo{
			Name: "a",
		},
		Foo{
			Name: "b",
		},
	})
	to, _ := json.Marshal([]Foo{
		Foo{
			Name: "c",
		},
	})
	_, err := patchwerk.Diff(
		[]byte(from),
		[]byte(to),
	)
	if err != nil {
		panic(err)
	}
}

It panics with: panic: runtime error: index out of range [1] with length 1

@gfxlabs gfxlabs linked a pull request Sep 15, 2022 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.

1 participant