From 65663c05331f93b1fa94533ef206a0aaa2827896 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 10 Mar 2014 10:32:45 -0400 Subject: [PATCH] Changed Windows sysData.setText() to panic on error. WM_SETTEXT's documentation indicates the main error is memory exhausted, which means we should panic anyway (unless the Go runtime already has). Any other error will be flagged as unexpected; since we're using SetWindowText() we can't differentiate between out of memory and other errors in the way WM_SETTEXT documents anyway. --- sysdata_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdata_windows.go b/sysdata_windows.go index a0935c9..798076b 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -254,7 +254,7 @@ func (s *sysData) setText(text string) error { } r := <-ret if r.ret == 0 { // failure - return r.err + panic(fmt.Errorf("error setting window/control text: %v", err)) } return nil }