Added comment why ominous assignment is required (#3021)

This commit is contained in:
Christian Muehlhaeuser 2019-07-19 08:31:29 +02:00 committed by Miek Gieben
parent d0c9254409
commit c928dbd754

View file

@ -128,6 +128,7 @@ func BenchmarkNewSRV(b *testing.B) {
s := &Service{Host: "www,example.org", Port: 8080}
for n := 0; n < b.N; n++ {
srv := s.NewSRV("www.example.org.", 16)
// this assignment makes sure s.NewSRV doesn't get optimized out
srv = srv
}
}