If you need to check if a string
is empty in Go, then there are two possible ways to immediately verify this:
Option 1 – Compare the length:
if len(s) > 0 {
// do something with string
}
Option 2 – Compare against blank:
if s != "" {
// do something with string
}