Skip to content

Commit

Permalink
internal/docs/design.md: forbid global state
Browse files Browse the repository at this point in the history
Updates google#931
  • Loading branch information
zombiezen committed Dec 11, 2018
1 parent d965a63 commit 31c7f0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ https://godoc.org/github.com/google/go-cloud/runtimevar#Variable
https://godoc.org/github.com/google/go-cloud/blob#Bucket.NewWriter
[`database/sql`]: https://godoc.org/database/sql

## No Global State

As a library, Go Cloud should not introduce global state. Global state is
difficult to reason about in large codebases, where it can be necessary for
different parts of the application to use different states. Instead of adding
global state, push responsibility to the application to inject the state where
it is needed.

## Package Naming Conventions

Inside this repository, we name packages that handle cloud services after the
Expand Down

0 comments on commit 31c7f0a

Please sign in to comment.