• Brad Fitzpatrick's avatar
    crypto/tls: add Config.Clone · d24f446a
    Brad Fitzpatrick authored
    In Go 1.0, the Config struct consisted only of exported fields.
    
    In Go 1.1, it started to grow private, uncopyable fields (sync.Once,
    sync.Mutex, etc).
    
    Ever since, people have been writing their own private Config.Clone
    methods, or risking it and doing a language-level shallow copy and
    copying the unexported sync variables.
    
    Clean this up and export the Config.clone method as Config.Clone.
    This matches the convention of Template.Clone from text/template and
    html/template at least.
    
    Fixes #15771
    Updates #16228 (needs update in x/net/http2 before fixed)
    Updates #16492 (not sure whether @agl wants to do more)
    
    Change-Id: I48c2825d4fef55a75d2f99640a7079c56fce39ca
    Reviewed-on: https://go-review.googlesource.com/28075
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
    d24f446a
common.go 25.5 KB