Exe file doesn´t open

Hi
I created a program that picks a random letter, but when I want to start it with the .exe file it closes immediatly, what should I do?
Im using Geany as an Editor, Im learning the language right now, but i can´t find anything that could help me.
this is my code:

package main

import (
“math/rand”
“fmt”
“time”
)

func main (){

rand.Seed(time.Now().Unix())
prompts:=[]string{"hatred","a, b, c, d, e "}

	fmt.Println("Ur prompt is: ", prompts[rand.Intn(len(prompts))])   

}

How do you start it?

That short program is expected to print something to it’s standard out and then exit.

the program isn´t for me, the person should start it by clicking on the exe file, but when I do that it closes immediatly

I’m not very proficient with the concept of clicking for a terminal application…

But perhaps just add some “press a key to close”?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.