8
8
8Yurasik82015-08-20 22:53:17
go
8Yurasik8, 2015-08-20 22:53:17

When you run a console program written in go, the Windows terminal immediately closes?

When you run a console program written in go, the Windows terminal immediately closes, please tell me how to fix this using the language itself.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
index0h, 2015-08-21
@8Yurasik8

Open the terminal first, your program is already in it. Don't run it in console mode.

D
DENIS SHELESTOV, 2015-08-21
@djdeniro

You can try to create a runner.bat file and run through it

@echo off
your programm here
pause

A
Artem @Jump, 2015-08-21
curated by the

This is normal behavior.

A
Andrey Pavlenko, 2015-08-21
@Akdmeh

As mentioned above, the program worked and closed.
There are two options:
1) put a pause console command at the end or ask the user to enter a line so that it does not immediately close
2) open cmd.exe, go to the desired folder, and open the program there - it will work and the output will be in the window, but the program itself will not close

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question