Golang regexp case insensitive

reg, err := regexp.Compile(strings.Replace(s.Name, " ", "[ \\._-]", -1))

ou can set a case-insensitive flag as the first item in the regex.

You do this by adding "(?i)" to the beginning of a regex.

reg, err := regexp.Compile("(?i)"+strings.Replace(s.Name, " ", "[ \\._-]", -1))

For a fixed regex it would look like this.

r := regexp.MustCompile(`(?i)CaSe`)