diff --git a/doc/code.html b/doc/code.html index 8cbfba04a0..fdca404ba4 100644 --- a/doc/code.html +++ b/doc/code.html @@ -24,21 +24,31 @@ A similar explanation is available as a
+Note that this differs from other programming environments in which every +project has a separate workspace and workspaces are closely tied to version +control repositories. +
+
-The go tool is designed to work with open source code maintained
-in public repositories. Although you don't need to publish your code, the model
-for how the environment is set up works the same whether you do or not.
-
-Go code must be kept inside a workspace. A workspace is a directory hierarchy with three directories at its root:
src contains Go source files organized into packages (one package per directory),
+src contains Go source files,
pkg contains package objects, and
bin contains executable commands.
-This workspace contains one repository (example)
-comprising two commands (hello and outyet)
-and one library (stringutil).
+The tree above shows a workspace containing two repositories
+(example and image).
+The example repository contains two commands (hello
+and outyet) and one library (stringutil).
+The image repository contains the bmp package
+and several others.
-A typical workspace would contain many source repositories containing many +A typical workspace contains many source repositories containing many packages and commands. Most Go programmers keep all their Go source code and dependencies in a single workspace.
@@ -133,10 +152,16 @@ please seego help gopath
--The packages from the standard library are given short paths such as +An import path is a string that uniquely identifies a package. +A package's import path corresponds to its location inside a workspace +or in a remote repository (explained below). +
+ +
+The packages from the standard library are given short import paths such as
"fmt" and "net/http".
For your own packages, you must choose a base path that is unlikely to
collide with future additions to the standard library or other external