aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
diff options
context:
space:
mode:
authorale <ale@incal.net>2021-06-19 17:48:06 +0000
committerale <ale@incal.net>2021-06-19 17:48:06 +0000
commit877afafd950b84242204499b3ed8c1b2c8c75f31 (patch)
tree864508749425be307061ba9aa772ac47df74c0da /vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
parent464a1701053f90a07946335768dc87ef68db88a3 (diff)
parenta4ceb326c4eb592ab989f1202584ea2cfded574f (diff)
downloadcrawl-877afafd950b84242204499b3ed8c1b2c8c75f31.tar.gz
crawl-877afafd950b84242204499b3ed8c1b2c8c75f31.zip
Merge branch 'renovate/github.com-google-go-cmp-0.x' into 'master'
Update module github.com/google/go-cmp to v0.5.6 See merge request ale/crawl!5
Diffstat (limited to 'vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go')
-rw-r--r--vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
index 0a01c47..44f4a5a 100644
--- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
+++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
@@ -1,6 +1,6 @@
// Copyright 2018, The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE.md file.
+// license that can be found in the LICENSE file.
// +build purego
@@ -21,3 +21,13 @@ func PointerOf(v reflect.Value) Pointer {
// assumes that the GC implementation does not use a moving collector.
return Pointer{v.Pointer(), v.Type()}
}
+
+// IsNil reports whether the pointer is nil.
+func (p Pointer) IsNil() bool {
+ return p.p == 0
+}
+
+// Uintptr returns the pointer as a uintptr.
+func (p Pointer) Uintptr() uintptr {
+ return p.p
+}