diff options
author | Nigel Tao <nigeltao@golang.org> | 2019-04-07 09:33:36 +1000 |
---|---|---|
committer | Nigel Tao <nigeltao@golang.org> | 2019-04-07 03:44:17 +0000 |
commit | 1c00deeaf96743362a103957266f92e47ff90bc6 (patch) | |
tree | 9a356d16cbf935462a9664594f7374f6c747c749 /src/image | |
parent | ad6c691542e2d842c90e2f7870021d16ffa71878 (diff) | |
download | go-1c00deeaf96743362a103957266f92e47ff90bc6.tar.gz go-1c00deeaf96743362a103957266f92e47ff90bc6.zip |
image: deprecate ZP and ZR
They were added a very long time ago, as a convenience before Go had
struct literals. Today, it is better to use the zero-valued literal. For
example, the compiler cannot prove that ZP or ZR have not been modified.
Change-Id: I7469f1c751e91bf76fe1eab07b5772eccb5d6405
Reviewed-on: https://go-review.googlesource.com/c/go/+/171097
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/geom.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/image/geom.go b/src/image/geom.go index ed7dde2c84..8bb249c1e0 100644 --- a/src/image/geom.go +++ b/src/image/geom.go @@ -67,6 +67,8 @@ func (p Point) Eq(q Point) bool { } // ZP is the zero Point. +// +// Deprecated: Use a literal image.Point{} instead. var ZP Point // Pt is shorthand for Point{X, Y}. @@ -254,6 +256,8 @@ func (r Rectangle) ColorModel() color.Model { } // ZR is the zero Rectangle. +// +// Deprecated: Use a literal image.Rectangle{} instead. var ZR Rectangle // Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}. The returned |