func (d *diff) hasChanged() bool {
	return len(d.instructions) != d.quantity
}
Has changed since last checkpoint
package golive
import (
	"golang.org/x/net/html"
	"strconv"
)
type DiffType int
func (dt DiffType) toString() string {
	return strconv.Itoa(int(dt))
}
const (
	Append DiffType = iota
	Remove
	SetInnerHTML
	SetAttr
	RemoveAttr
	Replace
	Move
)
type changeInstruction struct {
	changeType DiffType
	element    *html.Node
	content    string
	attr       attrChange
	index      int
}
type attrChange struct {
	name  string
	value string
}
type diff struct {
	actual       *html.Node
	instructions []changeInstruction
	quantity     int
	doneElements []*html.Node
}
func newDiff(actual *html.Node) *diff {
	return &diff{
		actual:       actual,
		instructions: make([]changeInstruction, 0),
	}
}
func (d *diff) instructionsByType(t DiffType) []changeInstruction {
	s := make([]changeInstruction, 0)
	for _, i := range d.instructions {
		if i.changeType == t {
			s = append(s, i)
		}
	}
	return s
}
func (d *diff) checkpoint() {
	d.quantity = len(d.instructions)
}