B
B
bodrich2019-02-08 07:44:16
go
bodrich, 2019-02-08 07:44:16

How to display time.Time in a human-readable format in GoLand debugger?

If in the Goland IDE, when the application is paused, look at the variables of type time.Time, then they will be in the form of a structure with the fields wall and ext. Is there a way to show these variables in the debugger, for example, as a string (2019-02-07T16:31:08.648Z). There are many such variables, and writing fmt.Println() everywhere is not very convenient.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Konyukhov, 2019-02-12
@bodrich

An example with phpstorm, but it doesn't change the essence: there is a "New watch" button in the debugger window. 5c627b304f382256072539.png
With it, you can monitor not only the state of the object, but also prepared expressions, for example, the formatted output of the date5c627b68827a2902525377.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question