]> Cypherpunks repositories - gostls13.git/commitdiff
time: update docs to clarify goroutine-safety expectations of Time
authorNicholas Maniscalco <nicholas@maniscalco.com>
Tue, 11 Apr 2017 20:27:41 +0000 (13:27 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 24 May 2017 06:11:03 +0000 (06:11 +0000)
Fixes #19935

Change-Id: I28e4cd6924f1b965a429a6a5ebfc4c0f952e8ae6
Reviewed-on: https://go-review.googlesource.com/40390
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/time/time.go

index 5283b7eb212a23a22da107496792015f2fd10354..ff016a6cad9eeb3ff436adbf22b4e8ae525b5a22 100644 (file)
@@ -81,8 +81,11 @@ import "errors"
 //
 // Programs using times should typically store and pass them as values,
 // not pointers. That is, time variables and struct fields should be of
-// type time.Time, not *time.Time. A Time value can be used by
-// multiple goroutines simultaneously.
+// type time.Time, not *time.Time.
+//
+// A Time value can be used by multiple goroutines simultaneously except
+// that the methods GobDecode, UnmarshalBinary, UnmarshalJSON and
+// UnmarshalText are not concurrency-safe.
 //
 // Time instants can be compared using the Before, After, and Equal methods.
 // The Sub method subtracts two instants, producing a Duration.