Web Development

It is very simple to check if a string is empty or not in Go Lang.

Go Lang Code to Check if Empty

if the_string == "" { 
  fmt.Println("the_string is empty")
}
if len(the_string) == 0 { 
  fmt.Println("the_string is empty")
}

Go Lang Code to Check if NOT Empty

if the_string != "" { 
  fmt.Println("the_string is not empty")
}
if len(the_string) != 0 { 
  fmt.Println("the_string is not empty")
}

Pretty straightforward!