package html func eq2(t1, t2 Tag) bool { if Name(t1) != Name(t2) { return false } a1, a2 := AllAttributes(t1), AllAttributes(t2) if len(a1.names) != len(a2.names) { return false } for i, name := range a1.names { if a2.names[i] != name { return false } v1 := a1.values[name] v2, ok := a2.values[name] if !ok || v1 != v2 { return false } } c1, c2 := Children(t1), Children(t2) if len(c1) != len(c2) { return false } for i := range c1 { ct1, ok1 := c1[i].(Tag) ct2, ok2 := c2[i].(Tag) if ok1 != ok2 { return false } if ok1 && !Eq(ct1, ct2) { return false } if !ok1 { continue } if c1[i] != c2[i] { return false } } return true } func eq(t ...Tag) bool { if len(t) < 2 { return true } if !eq2(t[0], t[1]) { return false } return eq(t[1:]...) }