What-changed is ready

Needs documenting, but the feature is ready for an application to really stress test the model and logic.

Guess what's next :) (after docs)

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2022-11-20 14:28:08 -05:00
parent 6c3cc97b04
commit ddf772270e
32 changed files with 392 additions and 356 deletions

View File

@@ -51,18 +51,12 @@ func CreateChange(changes *[]*Change, changeType int, property string, leftValue
func CreateContext(l, r *yaml.Node) *ChangeContext {
ctx := new(ChangeContext)
if l != nil {
ctx.OriginalLine = l.Line
ctx.OriginalColumn = l.Column
} else {
ctx.OriginalLine = -1
ctx.OriginalColumn = -1
ctx.OriginalLine = &l.Line
ctx.OriginalColumn = &l.Column
}
if r != nil {
ctx.NewLine = r.Line
ctx.NewColumn = r.Column
} else {
ctx.NewLine = -1
ctx.NewColumn = -1
ctx.NewLine = &r.Line
ctx.NewColumn = &r.Column
}
return ctx
}