once: replace all uses of package once with sync.Once.
package once remains for now; will be deleted after next release. R=golang-dev, brainman CC=golang-dev https://golang.org/cl/1914046
This commit is contained in:
parent
5f134f7d77
commit
10589a7c24
@ -9,7 +9,7 @@ import (
|
||||
"crypto/rsa"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"once"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -127,6 +127,8 @@ func mutualVersion(vers uint16) (uint16, bool) {
|
||||
// The defaultConfig is used in place of a nil *Config in the TLS server and client.
|
||||
var varDefaultConfig *Config
|
||||
|
||||
var once sync.Once
|
||||
|
||||
func defaultConfig() *Config {
|
||||
once.Do(initDefaultConfig)
|
||||
return varDefaultConfig
|
||||
|
Loading…
Reference in New Issue
Block a user