Commit 1c00deea authored by Nigel Tao's avatar Nigel Tao

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/+/171097Reviewed-by: default avatarNigel Tao <nigeltao@golang.org>
parent ad6c6915
...@@ -67,6 +67,8 @@ func (p Point) Eq(q Point) bool { ...@@ -67,6 +67,8 @@ func (p Point) Eq(q Point) bool {
} }
// ZP is the zero Point. // ZP is the zero Point.
//
// Deprecated: Use a literal image.Point{} instead.
var ZP Point var ZP Point
// Pt is shorthand for Point{X, Y}. // Pt is shorthand for Point{X, Y}.
...@@ -254,6 +256,8 @@ func (r Rectangle) ColorModel() color.Model { ...@@ -254,6 +256,8 @@ func (r Rectangle) ColorModel() color.Model {
} }
// ZR is the zero Rectangle. // ZR is the zero Rectangle.
//
// Deprecated: Use a literal image.Rectangle{} instead.
var ZR Rectangle var ZR Rectangle
// Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}. The returned // Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}. The returned
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment