Golang tips you might not know

1) gopkgs — List Go packages FAST by using the same implementation as goimports

2) goverage — go test -coverprofile for multiple packages

3) goplay — The Go Playground (https://play.golang.org/) client

4) reviewdog — filter lint result by diff

5) godebug — outputs diff between complex values for tests

if diff := pretty.Compare(test.before, test.after); diff != "" {
t.Errorf("%s: post-AddCrew diff: (-got +want)\n%s", test.desc, diff)
}
add first: post-AddCrew diff: (-got +want)
{
Name: "",
Crew: {
- Galactic President: "Zaphod Beeblebrox",
+ Zaphod Beeblebrox: "Galactic President",
},
Androids: 0,
Stolen: false,
}

Wrapping up

--

--

--

V!mm!shment Th!s World! https://github.com/haya14busa

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
haya14busa

haya14busa

V!mm!shment Th!s World! https://github.com/haya14busa

More from Medium

[golang] How to use github for hosting self-updating binaries for your golang projects

Context in Go

What is so special about Go?

Golang with Leetcode: 3Sum