freeconf / yang

Standards-based management for Golang microservices
Apache License 2.0
38 stars 15 forks source link

call OnEndEdit always(!) if OnBeginEdit called successfully #102

Closed sibuk-harabudjasim closed 7 months ago

sibuk-harabudjasim commented 7 months ago

This one is tricky. I need to hold mutex during changes and it is not possible if OnEndEdit is not called in case of some error. This PR ensures that OnEndEdit is being called each time OnBeginEdit is called and succeeds.

First, please do a detailed review of test, I'm not sure that this is the best way to test this functionality (test fails on unchanged edit.go but generously, it looks ugly). Second, please advice if there's another way of propagating changes back and forth from yang expected to be used instead of passing pointer to state?