FAQ
I have a string :

foo := "true & false | true"

How can i evaluate this string to get "true" as my result?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Jan 9, 2015 at 1:33 pm

    On Thu, Jan 8, 2015 at 10:05 PM, wrote:
    I have a string :

    foo := "true & false | true"

    How can i evaluate this string to get "true" as my result?
    You need to write some sort of parser and an expression evaluator.
    There is no direct support for this in the standard libraries.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matt Harden at Jan 10, 2015 at 2:26 pm
    Otto <http://godoc.org/github.com/robertkrimen/otto>? :-)
    On Fri Jan 09 2015 at 7:33:26 AM Ian Lance Taylor wrote:
    On Thu, Jan 8, 2015 at 10:05 PM, wrote:

    I have a string :

    foo := "true & false | true"

    How can i evaluate this string to get "true" as my result?
    You need to write some sort of parser and an expression evaluator.
    There is no direct support for this in the standard libraries.

    Ian

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 9, '15 at 6:05a
activeJan 10, '15 at 2:26p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase