How to output a boolean value in Go: printing true/false to the console
Hello everyone! I just started learning Go and encountered a simple but confusing situation. I'm writing a small program where I need to check some condition and output the result to the console. For example, I'm checking if a number is even and want to print true or false.
Here is my code:
```go
package main
import "fmt"
func isEven(n int) bool {
return n%2 == 0
}
func main() {
result := isEven(5)
// How do I output result? Just fmt.Println(result)?
fmt.Println(result)
}
```
When I run this code, it works and outputs `false`. But I'm not sure if this is the correct way. Maybe there are more elegant or standard formatting methods? I've seen that in other languages (e.g., in Python) you can write `print(result)` and it's fine, but in Go I've heard about the `f` package