Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The terminal is a third-party application that has nothing to do with the execution of the program, and it is also unlikely that it will be able to display messages there.
When you run a Go binary from a terminal, that terminal simply captures its stdout. When you open a terminal from an application, this terminal has nothing to intercept, because the application is launched from a different environment. You can, of course, first run the binary, which will open a terminal and run another binary in that terminal. Though I could be wrong of course.)
If simple terminal screen output, then fmt.Println()
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello world!")
}
And so?
import "os"
import "fmt"
fmt.Fprintf(os.Stdout, "your message here");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question