Skip to content

Commit

Permalink
chore: update godoc for instrument to have better test example (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko713 committed Mar 29, 2021
1 parent 9ae9a6d commit 1795c3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion instrument/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ Then call the functions:
For testing, you can create your own mock instrument and use it:
func TestSomething (t *testing.T) {
log := testutil.TL(t)
old := instrument.GetGlobalClient()
t.Cleanup(func(){ instrument.SetGlobalClient(old) })
instrument.SetGlobalClient(myMockClient)
instrument.SetGlobalClient(instrument.MockClient{Logger: log})
}
*/
package instrument

0 comments on commit 1795c3f

Please sign in to comment.