N
N
NubasLol2022-03-02 19:52:18
go
NubasLol, 2022-03-02 19:52:18

How can I prevent the terminal from closing on Windows after stopping the program with code 1?

When initializing the application, I use this construction

if config.Password == "" {
        log.Fatal("Значение password не заполнено")
    }


On Linux it works well, the program stops, the message is displayed. But on Windows, the terminal closes immediately. How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-03-02
@NubasLol

If you open the terminal in advance and run the executable file from it, it will not close.
Another option - if you have a windows terminal, then you can configure the behavior when the program crashes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question