forked from tools/godep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath.go
More file actions
30 lines (25 loc) · 643 Bytes
/
path.go
File metadata and controls
30 lines (25 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"fmt"
)
var cmdPath = &Command{
Usage: "path",
Short: "print sandbox path for use in a GOPATH",
Long: `
Path ensures a sandbox is prepared for the dependencies
in file Godeps. It prints a path for use in a GOPATH
that makes available the specified version of each dependency.
The printed path does not include any GOPATH value from
the environment.
For more about how GOPATH works, see 'go help gopath'.
`,
Run: runPath,
}
// Set up a sandbox and print the resulting gopath.
func runPath(cmd *Command, args []string) {
if len(args) != 0 {
cmd.UsageExit()
}
gopath := prepareGopath()
fmt.Println(gopath)
}