Reviewers: golang-dev_googlegroups.com,
Message:
Hello golang-dev@googlegroups.com,
I'd like you to review this change to
https://go.googlecode.com/hg/
Description:
syscall: attempt to find error message in "local" language before
resorting to error number on windows
Please review this at http://codereview.appspot.com/6499121/
Affected files:
M src/pkg/syscall/syscall_windows.go
Index: src/pkg/syscall/syscall_windows.go
===================================================================
--- a/src/pkg/syscall/syscall_windows.go
+++ b/src/pkg/syscall/syscall_windows.go
@@ -84,9 +84,10 @@
b := make([]uint16, 300)
n, err := FormatMessage(flags, 0, uint32(e), langid(LANG_ENGLISH,
SUBLANG_ENGLISH_US), b, nil)
if err != nil {
- // TODO(brainman): Call FormatMessage again asking for "native" error
message.
- // http://code.google.com/p/go/issues/detail?id=3376 must be resolved
first.
- return "winapi error #" + itoa(int(e))
+ n, err = FormatMessage(flags, 0, uint32(e), 0, b, nil)
+ if err != nil {
+ return "winapi error #" + itoa(int(e))
+ }
}
// trim terminating \r and \n
for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- {