From 8845fb7eae3e51fd3e55c47c377bf1a9e0cfe2a9 Mon Sep 17 00:00:00 2001 From: Maran Date: Mon, 14 Jul 2014 15:24:38 +0200 Subject: Add windows helper functions --- ethutil/common.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ethutil') 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) -- cgit