code: func onlyChildSelector(ofType bool) Selector {
  	return func(n *html.Node) bool {
  		if n.Type != html.ElementNode {
  			return false
  		}
  
  		parent := n.Parent
  		if parent == nil {
  			return false
  		}
  
  		if parent.Type == html.DocumentNode {
  			return false
  		}
  
  		count := 0
  		for c := parent.FirstChild; c != nil; c = c.NextSibling {
  			if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) {
  				continue
  			}
  			count++
  			if count > 1 {
  				return false
  			}
  		}
  
  		return count == 1
  	}
  }
docs: // onlyChildSelector returns a selector that implements :only-child.
  // If ofType is true, it implements :only-of-type instead.