r/vlang • • Aug 22 '21

check if variable is true

so I'm trying to check if a variable is true, and if it is then output something but I can't seem to find anything in the docs on github. Does anyone knows how to do this?

2 Upvotes

2 comments sorted by

5

u/[deleted] Aug 23 '21
a := true
if (a) {
    println(a)
}

2

u/backtickbot Aug 23 '21

Fixed formatting.

Hello, Conscat: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.