Przeglądaj źródła

Make go-tools happy

Signed-off-by: Christoph Ziebuhr <chris@codefrickler.de>
Christoph Ziebuhr 7 lat temu
rodzic
commit
6362d28969
2 zmienionych plików z 2 dodań i 4 usunięć
  1. 1 1
      libnetwork/resolver.go
  2. 1 3
      libnetwork/sandbox.go

+ 1 - 1
libnetwork/resolver.go

@@ -280,7 +280,7 @@ func (r *resolver) handleIPQuery(name string, query *dns.Msg, ipType int) (*dns.
 }
 
 func (r *resolver) handlePTRQuery(ptr string, query *dns.Msg) (*dns.Msg, error) {
-	parts := []string{}
+	var parts []string
 
 	if strings.HasSuffix(ptr, ptrIPv4domain) {
 		parts = strings.Split(ptr, ptrIPv4domain)

+ 1 - 3
libnetwork/sandbox.go

@@ -351,9 +351,7 @@ func (sb *sandbox) getConnectedEndpoints() []*endpoint {
 	defer sb.Unlock()
 
 	eps := make([]*endpoint, len(sb.endpoints))
-	for i, ep := range sb.endpoints {
-		eps[i] = ep
-	}
+	copy(eps, sb.endpoints)
 
 	return eps
 }