golang/go

all: document the default doc assumptions around concurrency, zero values, interfaces and return values

Open

#30,632 opened on Mar 6, 2019

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationNeedsInvestigationSuggestedhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

In general, across all go libraries, some documentation rules are implicit. As @bradfitz worded it:

The assumption when unstated is that things are not safe for concurrent use, that zero values are not usable, that implementations implement interfaces faithfully, and that only one return values is non-zero and meaningful.

This is a very important piece of knowledge and I think it should be documented somewhere. I don't know if the right place for it would be "Effective Go" (especially considering #28782) but it feels like newcomers should know this before they start browsing Go docs or writing Go code.

Contributor guide