$ go get -u github.com/davecgh/go-spew/spew
In VS Code, go to Preferences > User Snippets > Go
and add go.json
sd
snippet.
type sd to use the snippet
package main
import "github.com/davecgh/go-spew/spew"
func main() {
spew.Dump([]byte{'g', 'o', 'l', 'a', 'n', 'g'}) // DEBUG
}
Enjoy your debug
([]uint8) (len=6 cap=6) {
00000000 67 6f 6c 61 6e 67 |golang|
}