From bae2fc0d05e2ad00e106bf88b4fbdea567988ded Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 25 Feb 2019 16:18:17 +0100 Subject: Replace newErr with newError --- brush.go | 6 +++--- canvas.go | 2 +- dateedit.go | 2 +- graphicseffects.go | 2 +- linklabel.go | 4 ++-- resourcemanager.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/brush.go b/brush.go index 478b7d2e..617c4978 100644 --- a/brush.go +++ b/brush.go @@ -312,11 +312,11 @@ type GradientBrush struct { func NewGradientBrush(vertexes []GradientVertex, triangles []GradientTriangle) (*GradientBrush, error) { if len(vertexes) < 3 { - return nil, newErr("at least 3 vertexes are required") + return nil, newError("at least 3 vertexes are required") } if len(triangles) < 1 { - return nil, newErr("at least 1 triangle is required") + return nil, newError("at least 1 triangle is required") } var size Size @@ -395,7 +395,7 @@ func (b *GradientBrush) create(size Size) (*BitmapBrush, error) { } if !win.GradientFill(canvas.hdc, &vertexes[0], uint32(len(vertexes)), unsafe.Pointer(&triangles[0]), uint32(len(triangles)), win.GRADIENT_FILL_TRIANGLE) { - return nil, newErr("GradientFill failed") + return nil, newError("GradientFill failed") } disposables.Spare() diff --git a/canvas.go b/canvas.go index 7118c1cb..872bec7e 100644 --- a/canvas.go +++ b/canvas.go @@ -372,7 +372,7 @@ func (c *Canvas) GradientFillRectangle(color1, color2 Color, orientation Orienta } if !win.GradientFill(c.hdc, &vertices[0], 2, unsafe.Pointer(&indices), 1, uint32(orientation)) { - return newErr("GradientFill failed") + return newError("GradientFill failed") } return nil diff --git a/dateedit.go b/dateedit.go index 87cd8d0e..0440915b 100644 --- a/dateedit.go +++ b/dateedit.go @@ -160,7 +160,7 @@ func (de *DateEdit) SetFormat(format string) error { lp := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(format))) if 0 == de.SendMessage(win.DTM_SETFORMAT, 0, lp) { - return newErr("DTM_SETFORMAT failed") + return newError("DTM_SETFORMAT failed") } de.format = format diff --git a/graphicseffects.go b/graphicseffects.go index 73c921a8..5527e4db 100644 --- a/graphicseffects.go +++ b/graphicseffects.go @@ -168,7 +168,7 @@ func newWidgetGraphicsEffectList(observer widgetGraphicsEffectListObserver) *Wid func (l *WidgetGraphicsEffectList) Add(effect WidgetGraphicsEffect) error { if effect == nil { - return newErr("effect == nil") + return newError("effect == nil") } return l.Insert(len(l.items), effect) diff --git a/linklabel.go b/linklabel.go index 4c69fee4..d959e092 100644 --- a/linklabel.go +++ b/linklabel.go @@ -196,7 +196,7 @@ func (lll *LinkLabelLink) hasState(state uint32) (bool, error) { } if win.TRUE != lll.ll.SendMessage(win.LM_GETITEM, 0, uintptr(unsafe.Pointer(&li))) { - return false, newErr("LM_GETITEM") + return false, newError("LM_GETITEM") } return li.State&state == state, nil @@ -216,7 +216,7 @@ func (lll *LinkLabelLink) setState(state uint32, set bool) error { li.ILink = int32(lll.index) if win.TRUE != lll.ll.SendMessage(win.LM_SETITEM, 0, uintptr(unsafe.Pointer(&li))) { - return newErr("LM_SETITEM") + return newError("LM_SETITEM") } return nil diff --git a/resourcemanager.go b/resourcemanager.go index 95a00645..9e4741ca 100644 --- a/resourcemanager.go +++ b/resourcemanager.go @@ -116,5 +116,5 @@ func (rm *ResourceManager) Image(name string) (Image, error) { func (rm *ResourceManager) notFoundErr(typ, name string) error { path := filepath.Clean(filepath.Join(rm.rootDirPath, name)) - return newErr(fmt.Sprintf("neither %s resource '%s' nor file '%s' could be found or the image format is not supported", typ, name, path)) + return newError(fmt.Sprintf("neither %s resource '%s' nor file '%s' could be found or the image format is not supported", typ, name, path)) } -- cgit v1.2.3-59-g8ed1b