forked from forgejo/forgejo
go1.16 (#14783)
This commit is contained in:
parent
030646eea4
commit
47f6a4ec3f
947 changed files with 26119 additions and 7062 deletions
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"))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue