sourcegraph / go-langserver

Go language server to add Go support to editors and other tools that use the Language Server Protocol (LSP)
https://sourcegraph.com
MIT License
1.17k stars 90 forks source link

Use t.Cleanup instead of defer in Golang code tests #384

Open sourcegraph-bot opened 4 years ago

sourcegraph-bot commented 4 years ago

Using a proper defined cleanup function like

t.Cleanup(func () {
  // do sth
})

is more explicit than just

defer func () {
  // do sth
}

so let's use that approach.