LEFT | RIGHT |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // +build linux netbsd openbsd | 5 // +build linux netbsd openbsd |
6 | 6 |
7 package os | 7 package os |
8 | 8 |
9 import ( | 9 import ( |
10 "errors" | 10 "errors" |
11 "runtime" | 11 "runtime" |
12 ) | 12 ) |
13 | 13 |
14 func executable() (string, error) { | 14 func executable() (string, error) { |
15 switch runtime.GOOS { | 15 switch runtime.GOOS { |
16 case "linux": | 16 case "linux": |
17 » » return Readlink("/proc/self/exe") | 17 » » return "/proc/self/exe", nil |
18 case "netbsd": | 18 case "netbsd": |
19 » » return Readlink("/proc/curproc/exe") | 19 » » return "/proc/curproc/exe", nil |
20 case "openbsd": | 20 case "openbsd": |
21 » » return Readlink("/proc/curproc/file") | 21 » » return "/proc/curproc/file", nil |
22 } | 22 } |
23 return "", errors.New("Executable not implemented for " + runtime.GOOS) | 23 return "", errors.New("Executable not implemented for " + runtime.GOOS) |
24 } | 24 } |
LEFT | RIGHT |