This is the easiest thing I want to mention! Just use the equal (==) operator in golang:
// To check if it is empty
myString == ""
// To check if it is not empty
myString != ""
Code example:
package main
import "fmt"
func main() {
var myName string
if myName == "" {
fmt.Println("The name variable is empty")
}
myName = "Morteza"
if myName != "" {
fmt.Println("The name variable is:", myName)
}
}