An exported identifier is a Go package declaration whose name begins with an uppercase letter, making it accessible to other packages. Exporting defines the package boundary: code in a subdirectory does not inherit access to its parent package, and external code can use only exported elements. section 2.12.2
Exporting an API deliberately
// Customer is a customer representation. type Customer struct{} // ID returns the customer identifier. func (c Customer) ID() string { return "" } The uppercase names Customer and ID are available to clients of the package. Every exported element should have documentation beginning with its name; comments should explain intended use rather than implementation. section 2.15
Use exported identifiers as a small, intentional public surface:
- Export only what clients need; minimizing exports keeps package responsibilities clearer. section 2.12.2
- Do not assume that placing packages under a common directory grants special access; net/http can see only exported net elements. section 2.12.2
- Choose exported methods pragmatically: getters and setters can encapsulate validation, computed values, synchronization, or representation changes, but they are not mandatory in Go. section 2.4
- Document deprecations with a Deprecated: comment so tools can warn clients about replacement APIs. section 2.15
/net
/http
client.go
...
/smtp
auth.go
...
addrselect.go
...
The standard-library-style directory listing makes package boundaries visible: net contains related packages, while net/http and net/smtp remain distinct packages. section 2.12.2

