1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

move addr extractor to misc

This commit is contained in:
Asim Aslam
2017-01-12 13:20:34 +00:00
parent fd78e1d432
commit a9889730d6
6 changed files with 6 additions and 195 deletions

View File

@ -18,25 +18,6 @@ func (t *testHandler) Test(ctx context.Context, req *testRequest, rsp *testRespo
return nil
}
func TestExtractAddress(t *testing.T) {
data := []struct {
Input string
Output string
}{
{"10.0.0.1", "10.0.0.1"},
}
for _, d := range data {
addr, err := extractAddress(d.Input)
if err != nil {
t.Errorf("Expected %s: %v", d.Output, err)
}
if addr != d.Output {
t.Errorf("Expected %s, got %s", d.Output, addr)
}
}
}
func TestExtractEndpoint(t *testing.T) {
handler := &testHandler{}
typ := reflect.TypeOf(handler)