LBClient: panic on empty Clients

This commit is contained in:
Aliaksandr Valialkin
2016-11-07 17:21:28 +02:00
parent f49c6b3f96
commit 6cd438ba89
+3
View File
@@ -84,6 +84,9 @@ func (cc *LBClient) Do(req *Request, resp *Response) error {
}
func (cc *LBClient) init() {
if len(cc.Clients) == 0 {
panic("BUG: LBClient.Clients cannot be empty")
}
for _, c := range cc.Clients {
cc.cs = append(cc.cs, &lbClient{
c: c,