Saturday, May 18, 2024
HomeGolangWhen to make use of Examples? - Getting Assist

When to make use of Examples? – Getting Assist


Hello all,

When do you employ examples ? Do you mix them with godoc, are you able to share extra particulars when you’ve got been utilizing them.

Personally I’m experimenting with documenting code, and a few examples showing in godoc may very well be helpful, however am undecided if that is the usual.

Examples being included within the godoc is customary:

See additionally:

Subsequent, check out this instance:

After which check out the corresponding code:

https://cs.opensource.google/go/go/+/grasp:src/web/http/example_test.go;l=59?q=%2Fpercent2Fpercent20Simplepercent20staticpercent20webserver:&ss=gopercent2Fgo:srcpercent2Fnetpercent2Fhttppercent2F

For me, examples are sometimes all I have to get began with a module, and thus they’re extraordinarily helpful. I can get a fast instance after which uncover the opposite floor space of the module I’m utilizing through intellisense / spelunking straight by means of the supply. However I suppose it relies on the module.

1 Like

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments