diff options
author | Maran <maran.hidskes@gmail.com> | 2014-07-14 21:24:38 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-07-14 21:24:38 +0800 |
commit | 8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9 (patch) | |
tree | 9fa0071f2a1f8d20f7aeae187ab49cae94f72e93 | |
parent | 6426f3635eddaa1477e643886fd3c0eaf1fa6158 (diff) | |
download | go-tangerine-8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9.tar.gz go-tangerine-8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9.tar.zst go-tangerine-8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9.zip |
Add windows helper functions
-rw-r--r-- | ethutil/common.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ethutil/common.go b/ethutil/common.go index 6d88a1ed2..2fd031a20 100644 --- a/ethutil/common.go +++ b/ethutil/common.go @@ -3,8 +3,20 @@ package ethutil import ( "fmt" "math/big" + "runtime" ) +func IsWindows() bool { + return runtime.GOOS == "windows" +} + +func WindonizePath(path string) string { + if string(path[0]) == "/" && IsWindows() { + path = path[1:] + } + return path +} + // The different number of units var ( Douglas = BigPow(10, 42) |