mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
* all changes from v.13.2-x branch * squash initial changes * remove unneeded files * fix lint * gas estimation fix * accounts/keystore: fix test with sleep * rpc fixes * try with a smaller limit * logging * change the trim fn * remove main_test from rpc * txpool: remove unused "PendingFrom" * set local-txs-enabled in load tests * bump avago * bump coreth * resync (#1164) * resync * reapply fix * review comments * remove fixit comment * fix space in log levels (#1167) * fix legacy lvls (#1175) * fix legacy lvls * fix simulator logger * fix typo in rlpgen comment * update avalanchego to version with coreth on master branch --------- Co-authored-by: Ceyhun Onur <[email protected]>
33 lines
774 B
Go
33 lines
774 B
Go
// This file originates from Docker/Moby,
|
|
// https://github.com/moby/moby/blob/master/pkg/reexec/
|
|
// Licensed under Apache License 2.0: https://github.com/moby/moby/blob/master/LICENSE
|
|
// Copyright 2013-2018 Docker, Inc.
|
|
|
|
//go:build !linux
|
|
|
|
package reexec
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
"path/filepath"
|
|
)
|
|
|
|
// Self returns the path to the current process's binary.
|
|
// Uses os.Args[0].
|
|
func Self() string {
|
|
name := os.Args[0]
|
|
if filepath.Base(name) == name {
|
|
if lp, err := exec.LookPath(name); err == nil {
|
|
return lp
|
|
}
|
|
}
|
|
// handle conversion of relative paths to absolute
|
|
if absName, err := filepath.Abs(name); err == nil {
|
|
return absName
|
|
}
|
|
// if we couldn't get absolute name, return original
|
|
// (NOTE: Go only errors on Abs() if os.Getwd fails)
|
|
return name
|
|
}
|