You can try with this too,
re := regexp.MustCompile("\\$\\{(.*?)\\}")
str := "git commit -m '${abc}'"
res := re.FindAllStringSubmatch(str, 1)
for i := range res {
//like Java: match.group(1)
fmt.Println("Message :", res[i][1])
}
GoPlay: https://play.golang.org/p/PFH2oDzNIEi