File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
package internal
2
2
3
3
import (
4
+ "net"
4
5
"os"
5
6
"strings"
6
7
@@ -53,6 +54,14 @@ func (s keepAliveServer) Start(fn RegisterFn) error {
53
54
return s .Server .Start (fn )
54
55
}
55
56
57
+ func (s keepAliveServer ) StartWithListener (listener net.Listener , fn RegisterFn ) error {
58
+ if err := s .registerEtcd (); err != nil {
59
+ return err
60
+ }
61
+
62
+ return s .Server .StartWithListener (listener , fn )
63
+ }
64
+
56
65
func figureOutListenOn (listenOn string ) string {
57
66
fields := strings .Split (listenOn , ":" )
58
67
if len (fields ) == 0 {
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ func TestNewRpcPubServer(t *testing.T) {
18
18
assert .NotPanics (t , func () {
19
19
s .Start (nil )
20
20
})
21
+
22
+ assert .NotPanics (t , func () {
23
+ s .StartWithListener (nil , nil )
24
+ })
21
25
}
22
26
23
27
func TestFigureOutListenOn (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments