2825 explained code solutions for 75 technologies


golangHow to use if...else


package main

func main() {
  x := 5
  if x > 0 {
    print("here")
  } else {
    print("there")
  }
}ctrl + c
package main

default package declaration

func main() {

declare main function that will be launched automatically

if

start if block with condition to check

else

execute this block if previous condition(s) were not met