[ARM] Fix typo in comment in arm_expand_prologue
[official-gcc.git] / libgo / go / os / executable_solaris.go
blob80f937201ac89e7533baa818083d13ee06b3ed72
1 // Copyright 2016 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.
5 package os
7 import "syscall"
9 var initCwd, initCwdErr = Getwd()
11 func executable() (string, error) {
12 path, err := syscall.Getexecname()
13 if err != nil {
14 return path, err
16 if len(path) > 0 && path[0] != '/' {
17 if initCwdErr != nil {
18 return path, initCwdErr
20 if len(path) > 2 && path[0:2] == "./" {
21 // skip "./"
22 path = path[2:]
24 return initCwd + "/" + path, nil
26 return path, nil