Created
May 28, 2014 10:55
-
-
Save obscuren/f7ff89e0bcfef39f6a42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
out := ethutil.StringToByteFunc(str, func(s string) (ret []byte) { | |
ret = doSomethingWith(s) | |
return | |
}) | |
// == | |
var out []byte | |
if s[0:2] == "0x" { | |
out = fromHex([2:]) | |
} else { | |
out = doSomethingWith(s) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment