File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ func (*headerSha256Spec) Create(args []interface{}) (routing.Predicate, error) {
37
37
return nil , predicates .ErrInvalidPredicateParameters
38
38
}
39
39
40
- var hashes [][sha256 .Size ]byte
41
- for _ , arg := range args [1 :] {
40
+ args = args [1 :]
41
+
42
+ hashes := make ([][sha256 .Size ]byte , 0 , len (args ))
43
+ for _ , arg := range args {
42
44
hexHash , ok := arg .(string )
43
45
if ! ok {
44
46
return nil , predicates .ErrInvalidPredicateParameters
@@ -50,7 +52,7 @@ func (*headerSha256Spec) Create(args []interface{}) (routing.Predicate, error) {
50
52
if len (hash ) != sha256 .Size {
51
53
return nil , predicates .ErrInvalidPredicateParameters
52
54
}
53
- hashes = append (hashes , * ( * [sha256 .Size ]byte )(hash )) // https://github.com/golang/go/issues/46505
55
+ hashes = append (hashes , ( [sha256 .Size ]byte )(hash ))
54
56
}
55
57
56
58
return & headerSha256Predicate {name , hashes }, nil
You can’t perform that action at this time.
0 commit comments