Evaluating boolean expression in a string - Go
<p>I have a boolean expression in string format, example:</p>

<pre><code>name := "Fred"

type := "Person"
</code></pre>

<p>I want to evaluate this expression as true or false. </p>

<pre><code>exp := "(name == Fred) &amp;&amp; (type == Person)"
</code></pre>

<p>Eventually, I would like to be able to execute conditional statements such as:</p>

<pre><code>if (exp) {
    ...
}
</code></pre>

<p>However, from research this is not something Go supports out of the box. I have seen suggestions on using AST to parse and evaluate. But, I am fairly new to go and especially AST, thus not sure how to go about that. Can someone please provide any guidance on how I may go about evaluating a string boolean expression? I have not come across any packages that support this entirely. </p>