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:
Rob Pike 2010-08-06 06:14:41 +10:00
parent 5f134f7d77
commit 10589a7c24

View File

@ -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