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

Remove passing of anonymous visualize function #19089

Open
serathius opened this issue Dec 19, 2024 · 3 comments · May be fixed by #19094
Open

Remove passing of anonymous visualize function #19089

serathius opened this issue Dec 19, 2024 · 3 comments · May be fixed by #19094

Comments

@serathius
Copy link
Member

What would you like to be added?

Before linearizationInfo was a private struct we were not able to return the results up the call stack. So I wrapped the function I needed and passed it like

return result, func(path string) error {
lg.Info("Saving visualization", zap.String("path", path))
err := porcupine.VisualizePath(model.NonDeterministicModel, info, path)
if err != nil {
return fmt.Errorf("failed to visualize, err: %w", err)
}
return nil
}

With https://github.com/etcd-io/etcd/blob/main/tests/robustness/validate/operations.go#L49-L56 making the struct piblic we can simply replace it with passing it linearizationInfo.

Why is this needed?

Cleanup code

@serathius
Copy link
Member Author

As VisualizePath function needs also model as argument, maybe we can wrap it in struct with Visualize method:

type Results struct {
  info pourcupine.LinearizationInfo
  model pourcupine.Model
}

@lhajouji
Copy link

Hello @serathius , i'd like to work on this ?
Could you assign it to me, Thanks in advance.

@VidhuSarwal
Copy link

Hi, I submitted a PR please review. Thanks.

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

Successfully merging a pull request may close this issue.

3 participants