golang/go

all: simplify standard library examples

Open

#36.417 aperta il 6 gen 2020

Vedi su GitHub
 (11 commenti) (9 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsInvestigationhelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Over the last few years, Go standard library has done a great job by improving the examples coverage. However, some of the examples are difficult to read or too comprehensive to be a reference for basic usage.

Standard library examples can help more if they were simpler and more copy/paste-able. More comprehensive scenarios can be covered as secondary examples or in other mediums such as https://gobyexample.com/.

Here are some examples:

Sorry for having to nitpick these examples, there are more cases in the standard library and it would be great to turn some of these examples into more digest ones.

Having said that, I see some packages (such as the io ones) might be better with comprehensive examples where edge cases are explained and demonstrable by running the example program because APIs are not always doing a great job explaining the behavior.

Guida contributor