Source file src/os/executable.go

     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.
     4  
     5  package os
     6  
     7  // Executable returns the path name for the executable that started
     8  // the current process. There is no guarantee that the path is still
     9  // pointing to the correct executable. If a symlink was used to start
    10  // the process, depending on the operating system, the result might
    11  // be the symlink or the path it pointed to. If a stable result is
    12  // needed, path/filepath.EvalSymlinks might help.
    13  //
    14  // Executable returns an absolute path unless an error occurred.
    15  //
    16  // The main use case is finding resources located relative to an
    17  // executable.
    18  func Executable() (string, error) {
    19  	return executable()
    20  }
    21  

View as plain text