Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(525)

Side by Side Diff: src/pkg/os/executable_darwin.go

Issue 6736069: code review 6736069: runtime, syscall, os: add os.ExecPath() (string, error)
Patch Set: diff -r 8df088298a0c https://code.google.com/p/go/ Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package os
6
7 var progPath string // set by ../runtime/progpath_darwin.c
r 2012/10/28 17:47:49 you've still got some progpaths around, in differe
8
9 var initCwd, initCwdErr = Getwd()
10
11 func executable() (string, error) {
12 if progPath[0] != '/' {
13 if initCwdErr != nil {
14 return progPath, initCwdErr
15 } else {
16 if progPath[0] == '.' {
17 // skip "./"
18 progPath = progPath[2:]
19 }
20 return initCwd + "/" + progPath, nil
21 }
22 }
23 return progPath, nil
24 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b