I want to get contents of html.Node
as a string.
Example:
<div id="my-node">
<p>First paragraph</p>
<p>Second paragraph</p>
</div>
Given myNode := html.Node("#my-node")
(pseudocode), I want to retrieve entire above html as a string. Indentation does not matter.
I couldn't find anything on the internet except iterating over contents of node - myNode.NextSibling
but its over complicated and I'm pretty sure there has to be easier way.
Update:
I'm reffering to golang.org/x/net/html
package.