code: func (p *Probe) ResolveSelf(argv0 string) error {
  	if p.Self != "" {
  		return nil
  	}
  
  	// Get the authoritative executable from the system.
  	exec, err := os.Executable()
  	if err != nil {
  		return errors.Annotate(err, "failed to get executable").Err()
  	}
  
  	execStat, err := os.Stat(exec)
  	if err != nil {
  		return errors.Annotate(err, "failed to stat executable: %s", exec).Err()
  	}
  
  	// Before using "os.Executable" result, which is known to resolve symlinks on
  	// Linux, try and identify via argv0.
  	if argv0 != "" && filesystem.AbsPath(&argv0) == nil {
  		if st, err := os.Stat(argv0); err == nil && os.SameFile(execStat, st) {
  			// argv[0] is the same file as our executable, but may be an unresolved
  			// symlink. Prefer it.
  			p.Self, p.SelfStat = argv0, st
  			return nil
  		}
  	}
  
  	p.Self, p.SelfStat = exec, execStat
  	return nil
  }
docs: // ResolveSelf attempts to identify the current process. If successful, p's
  // Self will be set to an absolute path reference to Self, and its SelfStat
  // field will be set to the os.FileInfo for that path.
  //
  // If this process was invoked via symlink, the path to the symlink will be
  // returned if possible.