Edit : Only aiming Windows
Hey i am trying to run different stuff with Golang, from images to text files
Carrefull ! I am not trying to display them but open them !
Like openning a regular text file like cmd would do with start filePath.txt would open in world.
I tried MANY methods but none of them worked. The only one that worked was with an executable, and instead of opening independently, it was attached to my current program, meaning all output where show in the same current console.
here is my current (not doing anything code)
func UpdateProject(downloadString string) {
var linkData = strings.Split(downloadString, "/")
var fileName = linkData[len(linkData)-1]
f, _ := os.Create(fileName)
defer f.Close()
resp, _ := http.Get(downloadString)
body, _ := ioutil.ReadAll(resp.Body)
f.WriteString(string(body))
exec.Command("cmd", "start", fileName).Run()
}
I hope getting some help and insist on the fact that i just want to open the file like windows would when double clicking on it. Thanks by advance !