summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 13:36:24 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 13:36:24 -0500
commitd1768f27873fe277cfe2513203424afdd2a84d5d (patch)
tree50070398090ae2e4150acb5bf5d2d31ffce08dab /sysdata_windows.go
parentdce24dae3f4a737d66f13a12b2e09b37b4e7e3aa (diff)
Reduced the number of unnecessary error returns based on MSDN. The TODOs that used to be there have been moved to a new file; similar files for Mac and Linux will also be made.
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index 5a197bf..34ec3cb 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -244,8 +244,7 @@ func (s *sysData) setRect(x int, y int, width int, height int) error {
return nil
}
-// TODO figure out how to handle error
-func (s *sysData) isChecked() (bool, error) {
+func (s *sysData) isChecked() bool {
ret := make(chan uiret)
defer close(ret)
uitask <- &uimsg{
@@ -259,16 +258,14 @@ func (s *sysData) isChecked() (bool, error) {
ret: ret,
}
r := <-ret
- return r.ret == _BST_CHECKED, nil
+ return r.ret == _BST_CHECKED
}
-// TODO adorn error messages with which part failed
-func (s *sysData) text() (str string, err error) {
+func (s *sysData) text() (str string) {
var tc []uint16
ret := make(chan uiret)
defer close(ret)
- // TODO figure out how to handle errors
uitask <- &uimsg{
call: _sendMessage,
p: []uintptr{
@@ -282,7 +279,6 @@ func (s *sysData) text() (str string, err error) {
r := <-ret
length := r.ret + 1 // terminating null
tc = make([]uint16, length)
- // TODO figure out how to handle errors
uitask <- &uimsg{
call: _sendMessage,
p: []uintptr{
@@ -294,8 +290,7 @@ func (s *sysData) text() (str string, err error) {
ret: ret,
}
<-ret
- // TODO check character count
- return syscall.UTF16ToString(tc), nil
+ return syscall.UTF16ToString(tc)
}
// TODO figure out how to handle errors