aboutsummaryrefslogtreecommitdiff
path: root/_content/doc/tutorial/database-access.md
diff options
context:
space:
mode:
authorSteve Traut <straut@google.com>2021-08-19 10:27:41 -0400
committerSteve Traut <straut@google.com>2021-09-08 14:57:14 +0000
commit12eac51beafb23e225a5e486c056626386672c60 (patch)
tree2acafc1d23013ea6efed7d5b4260a9a360638c1d /_content/doc/tutorial/database-access.md
parent06d6b9d29b8244fe90ea8518bd521344fd4d87e8 (diff)
downloadgo-x-website-12eac51beafb23e225a5e486c056626386672c60.tar.xz
_content/doc: module naming best practices
This adds new content with best practices for the module path. It also revises existing content to use the best practice. This change includes: * A new "Naming a module" section in "Managing dependencies" describing naming best practices and reserved terms for module paths. * Changing module path prefix from "example.com/*" to "example/*" where the content seems aimed specifically at new users. This is designed to reduce confusion for those who wonder if a domain name is required in the local, simple context. * Links to the "Naming a module" section so that new users can follow up from the simple case to learn about best practices. Change-Id: I07eac1f805ce506a486d3c0e7b54539554e3c30b Reviewed-on: https://go-review.googlesource.com/c/website/+/344469 Trust: Steve Traut <straut@google.com> Trust: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to '_content/doc/tutorial/database-access.md')
-rw-r--r--_content/doc/tutorial/database-access.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/_content/doc/tutorial/database-access.md b/_content/doc/tutorial/database-access.md
index 16a3d7c1..361021f2 100644
--- a/_content/doc/tutorial/database-access.md
+++ b/_content/doc/tutorial/database-access.md
@@ -78,14 +78,18 @@ To begin, create a folder for the code you'll write.
Run the `go mod init` command, giving it your new code's module path.
```
- $ go mod init example.com/data-access
- go: creating new go.mod: module example.com/data-access
+ $ go mod init example/data-access
+ go: creating new go.mod: module example/data-access
```
This command creates a go.mod file in which dependencies you add will be
listed for tracking. For more, be sure to see
[Managing dependencies](/doc/modules/managing-dependencies).
+ **Note:** In actual development, you'd specify a module path that's
+ more specific to your own needs. For more, see
+ [Managing dependencies](/doc/modules/managing-dependencies#naming_module).
+
Next, you'll create a database.
## Set up a database {#set_up_database}