Go Boolean Data Type

The Boolean data type in Go is declared using the bool keyword. It represents two values:

Tutorials dojo strip
  • true
  • false

The default value of a Boolean variable is false.




Example: Declaring Boolean Variables

This example demonstrates various ways to declare Boolean variables:

Go

Output:

Go
Tutorials dojo strip