mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 12:07:20 +00:00
go1.16 (#14783)
This commit is contained in:
14
vendor/github.com/go-testfixtures/testfixtures/v3/bytes.go
generated
vendored
Normal file
14
vendor/github.com/go-testfixtures/testfixtures/v3/bytes.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
package testfixtures
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (l *Loader) tryHexStringToBytes(s string) ([]byte, error) {
|
||||
if !strings.HasPrefix(s, "0x") {
|
||||
return nil, fmt.Errorf("not a hexadecimal string, must be prefix 0x")
|
||||
}
|
||||
return hex.DecodeString(strings.TrimPrefix(s, "0x"))
|
||||
}
|
Reference in New Issue
Block a user