aboutsummaryrefslogtreecommitdiff
path: root/cmp
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2018-02-28 15:56:57 -0800
committerJoe Tsai <joetsai@digital-static.net>2018-02-28 15:56:57 -0800
commit0c93777250bd58222171888d1651979319d8b381 (patch)
treea13bc275c553f734fc23eb522bb5d367e51295de /cmp
parent3af367b6b30c263d47e8895973edcca9a49cf029 (diff)
downloadgo-cmp-0c93777250bd58222171888d1651979319d8b381.tar.gz
Update TODO for when to remove sanitizeValue
Diffstat (limited to 'cmp')
-rw-r--r--cmp/compare.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmp/compare.go b/cmp/compare.go
index 7e215f2..1260603 100644
--- a/cmp/compare.go
+++ b/cmp/compare.go
@@ -380,8 +380,9 @@ func detectRaces(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value) {
// assuming that T is assignable to R.
// Otherwise, it returns the input value as is.
func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value {
- // TODO(dsnet): Remove this hacky workaround.
- // See https://golang.org/issue/22143
+ // TODO(dsnet): Workaround for reflect bug (https://golang.org/issue/22143).
+ // The upstream fix landed in Go1.10, so we can remove this when drop support
+ // for Go1.9 and below.
if v.Kind() == reflect.Interface && v.IsNil() && v.Type() != t {
return reflect.New(t).Elem()
}