comparison managesieve.go @ 8:75a4ee940f36

Fix SRV record lookup Fill the preallocated array of host/port strings instead of incorrectly appending to a preallocated array already filled with empty strings.
author Guido Berhoerster <guido+managesieve@berhoerster.name>
date Wed, 03 Feb 2021 13:02:39 +0100
parents f9bb517e9447
children b790df0733d4
comparison
equal deleted inserted replaced
7:d49bcc337710 8:75a4ee940f36
106 return services[:], nil 106 return services[:], nil
107 } 107 }
108 } 108 }
109 return nil, err 109 return nil, err
110 } 110 }
111 services := make([]string, len(addrs)) 111 services := make([]string, 0, len(addrs))
112 // addrs is already ordered by priority 112 // addrs is already ordered by priority
113 for _, addr := range addrs { 113 for _, addr := range addrs {
114 services = append(services, 114 services = append(services,
115 fmt.Sprintf("%s:%d", addr.Target, addr.Port)) 115 fmt.Sprintf("%s:%d", addr.Target, addr.Port))
116 } 116 }