Check out example codes for "if statement string compare go". It will help you in understanding the concepts better.

Code Example 1

import "strings"

// if string found in name it returns 0 else 1
if strings.Compare(command, "h") == 0 {
  // Do something
}

Code Example 2

import "strings"

// if string found in name it returns 0 else 1
if strings.Compare(name, "compare string") == 1 {
	// Do something
}

Learn ReactJs, React Native from akashmittal.com