---
title: "Discussion on \"Conditionals (if-else) in Go\" | Hashnode"
description: "Discussion on \"Conditionals (if-else) in Go\". The most basic statement in every programming language is the \"if\" statement.\nIt is used when we need to do something based on some conditions.\nIf Statement\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n    age := 21\n    if age > 20 {\n        fmt.Println..."
url: "https://hashnode.com/posts/conditionals-if-else-in-go/5ff4a401e8e57e1374e69312"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Conditionals (if-else) in Go](https://diegocmsantos.hashnode.dev/conditionals-if-else-in-go?utm_source=hashnode&utm_medium=feed)

The most basic statement in every programming language is the "if" statement. It is used when we need to do something based on some conditions. If Statement package main import "fmt" func main() { age := 21 if age > 20 { fmt.Println...

Jan 5, 2021 · 3 min read · diegocmsantos.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#basics](https://hashnode.com/tag/basics)

## Written by

[Diego Maia](https://hashnode.com/@diegocmsantos)

@diegocmsantos

  
[View profile](https://hashnode.com/@diegocmsantos)

Web development

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
