if runtime.GOOS == "windows" { githash, _ = sh.Output("magefiles\\getGithash.bat") githash = strings.ReplaceAll(githash, "\r", "") timestamp, _ = sh.Output("magefiles\\getTimestamp.bat") timestamp = strings.ReplaceAll(timestamp, "\r", "") timestamp = strings.ReplaceAll(timestamp, "'", "") } else if runtime.GOOS == "darwin" { githash, _ = sh.Output("magefiles\\getGithash.sh") githash = strings.ReplaceAll(githash, "\r", "") timestamp, _ = sh.Output("magefiles\\getTimestamp.sh") timestamp = strings.ReplaceAll(timestamp, "\r", "") timestamp = strings.ReplaceAll(timestamp, "'", "") } Needs an else for linux