This... or just specify the type after 'arr' such as:

if arr.(bool) {
    fmt.Println("This is a boolean value")
}


On Monday, January 29, 2018 at 5:41:17 AM UTC-6, Jan Mercl wrote:
>
> On Mon, Jan 29, 2018 at 12:36 PM pradam <pradam.pr...@gmail.com 
> <javascript:>> wrote:
>
> > //here its throwing error like: non-boolean condition in if statement
>
> The compiler is right. 'arr' is not a boolean expresion, its type is 
> 'interface{}'. Try: https://play.golang.org/p/zwNV9RD2oCs.
>
> -- 
>
> -j
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to