IsProbablyGoRun loosely checks if the current program was started with "go run".
()
| 9 | |
| 10 | // IsProbablyGoRun loosely checks if the current program was started with "go run". |
| 11 | func IsProbablyGoRun() bool { |
| 12 | for _, dir := range runDirs { |
| 13 | if dir != "" && strings.HasPrefix(os.Args[0], dir) { |
| 14 | return true |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | return false |
| 19 | } |
| 20 | |
| 21 | func cacheDir() string { |
| 22 | dir := os.Getenv("GOCACHE") |
no outgoing calls
searching dependent graphs…