Just sharing a small project that might be useful for anyone interested in Go language and terminal UIs. This is a proof of concept of a terminal multiplexer. The project is very simple, there are just a couple of key source files.
… Без рубрики
Java Optional implementation in Golang
On the moment of writing generics in Golang (v1.26) are not very flexible, however you can implement something which almost feels like true Java.
Code snippet to print out a go app memory status
Helps to trace memory leaks in a Golang application.
|
1 2 3 4 5 6 7 |
// For clearer results it's better to call this function after runtime.GC() invocation. // The code was borrowed from 100 go mistakes book. func printAlloc() { var m runtime.MemStats runtime.ReadMemStats(&m) fmt.Printf("%d KB\n", m.Alloc/1024) } |