A utility for filling Go values.
package main
import (
"crypto/tls"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"lesiw.io/fill"
)
func TestTlsConfigClone(t *testing.T) {
opts := cmp.Options{cmpopts.IgnoreUnexported(tls.Config{})}
for range 100 {
cfg := new(tls.Config)
fill.Rand(cfg)
if want, got := cfg, cfg.Clone(); !cmp.Equal(want, got, opts) {
t.Fatalf("-original +cloned\n%s", cmp.Diff(want, got, opts))
}
}
}