Q:

"exit status 128" trying to create git branches from golang

I am trying to create a "feature branch" from golang. The following code is not working:
reader := bufio.NewReader(os.Stdin)
fmt.Print(color.RedString("New feature description: "))
featureName, _ := reader.ReadString('\n')
featureName = strings.ReplaceAll(featureName, " ", "-")
featureBranchName := "feature/" + featureName
cmdStartBranch := "git"
arguments := []string{"checkout", "-b", featureBranchName}
if _, err := exec.Command(cmdStartBranch, arguments...).Output(); err != nil {
    fmt.Println(color.RedString(err.Error()))
    os.Exit(1)
}

But hardcoding featureBranchName it works:
cmdStartBranch := "git"
arguments := []string{"checkout", "-b", "feature/ciaone-proprio"}
if _, err := exec.Command(cmdStartBranch, arguments...).Output(); err != nil {
    fmt.Println(color.RedString(err.Error()))
    os.Exit(1)
}

A:

ReadString('\n') returns the delimiter '\n', you need to remove it.
featureName, err := reader.ReadString('\n')
if err == nil {
    n := len(featureName)
    featureName = featureName[:n-1]
}

...

