golang/go

x/pkgsite/internal/fetch/dochtml/internal/render: leave a sample of values when trimming large string literals and composite literals

Aperta

#39.907 aperta il 29 giu 2020

 (4 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
FeatureRequestNeedsInvestigationhelp wantedpkgsitepkgsite/dochtml

Metriche repository

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

Descrizione

In godoc.org: https://godoc.org/github.com/rocketlaunchr/google-search (for example),

If you have a map package-level variable with many many predefined values, it doesn't display any of them:

var GoogleDomains = map[string]string{ /* 198 elements not displayed */

}

It would be more useful if displayed some values to give an idea of the kind of values stored:

var GoogleDomains = map[string]string{
	"us":  "https://www.google.com/search?q=",
	"ac":  "https://www.google.ac/search?q=",
	"ad":  "https://www.google.ad/search?q=",
	... /* 195 elements not displayed */

Guida contributor