fixes and improvements #55

Merged
vtolstov merged 6 commits from util-router into master 2021-08-03 00:24:40 +03:00
4 changed files with 7 additions and 20 deletions
Showing only changes of commit 46d4461f6d - Show all commits

View File

@ -25,7 +25,7 @@ func TestCompile(t *testing.T) {
segs: []segment{ segs: []segment{
literal(eof), literal(eof),
}, },
ops: []int{int(utilities.OpLitPush), 0}, ops: []int{int(OpLitPush), 0},
pool: []string{""}, pool: []string{""},
}, },
{ {

View File

@ -3,11 +3,8 @@ package router
// download from https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/master/protoc-gen-grpc-gateway/httprule/parse.go // download from https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/master/protoc-gen-grpc-gateway/httprule/parse.go
import ( import (
"context"
"fmt" "fmt"
"strings" "strings"
"github.com/unistack-org/micro/v3/logger"
) )
// InvalidTemplateError indicates that the path template is not valid. // InvalidTemplateError indicates that the path template is not valid.

View File

@ -4,7 +4,6 @@ package router
import ( import (
"context" "context"
"flag"
"fmt" "fmt"
"reflect" "reflect"
"testing" "testing"
@ -135,10 +134,6 @@ func TestTokenize(t *testing.T) {
} }
func TestParseSegments(t *testing.T) { func TestParseSegments(t *testing.T) {
err := flag.Set("v", "3")
if err != nil {
t.Fatalf("failed to set flag: %v", err)
}
for _, spec := range []struct { for _, spec := range []struct {
tokens []string tokens []string
want []segment want []segment
@ -298,10 +293,6 @@ func TestParseSegments(t *testing.T) {
} }
func TestParseSegmentsWithErrors(t *testing.T) { func TestParseSegmentsWithErrors(t *testing.T) {
err := flag.Set("v", "3")
if err != nil {
t.Fatalf("failed to set flag: %v", err)
}
for _, spec := range []struct { for _, spec := range []struct {
tokens []string tokens []string
}{ }{

View File

@ -149,7 +149,6 @@ func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, er
stacksize: maxstack, stacksize: maxstack,
tailLen: tailLen, tailLen: tailLen,
verb: verb, verb: verb,
assumeColonVerb: options.assumeColonVerb,
}, nil }, nil
} }