allow prefix 0x in byte field set
This commit is contained in:
parent
69114e6782
commit
88c7d63adc
|
@ -173,6 +173,7 @@ func (part *filePart) setHandling() {
|
||||||
return hex.EncodeToString(buf)
|
return hex.EncodeToString(buf)
|
||||||
}
|
}
|
||||||
writeTo := func(w io.Writer, bo binary.ByteOrder, s string) {
|
writeTo := func(w io.Writer, bo binary.ByteOrder, s string) {
|
||||||
|
s = strings.TrimPrefix(s, "0x")
|
||||||
buf, err := hex.DecodeString(s)
|
buf, err := hex.DecodeString(s)
|
||||||
optPanic("invalid string of hex values: "+s, err)
|
optPanic("invalid string of hex values: "+s, err)
|
||||||
if int64(len(buf)) > bytes {
|
if int64(len(buf)) > bytes {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user