mailgun / holster

A place to keep useful golang functions and small libraries
Apache License 2.0
287 stars 35 forks source link

mxresolv.Lookup() now properly randomized hosts in some situations #175

Closed thrawn01 closed 1 year ago

thrawn01 commented 1 year ago

Purpose

mxresolv.Lookup() was not properly randomzing MX hosts returned in some situations.

Implementation

// pkg: github.com/mailgun/holster/v4/mxresolv
// BenchmarkShuffleWithNew
// BenchmarkShuffleWithNew-10       61962        18434 ns/op    5376 B/op       1 allocs/op
// BenchmarkShuffleGlobal
// BenchmarkShuffleGlobal-10        65205       18480 ns/op       0 B/op        0 allocs/op