go.sys/windows: delete errors_windows.go (except APPLICATION_ERROR) and Errno

All consts in errors_windows.go (except APPLICATION_ERROR) were
"invented" at the start of windows port to have minimal impact on
existing Go packages. No point keeping them around.
Also remove Errno, since we will be using syscall.Errno everywhere anyway.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/128290044
This commit is contained in:
Alex Brainman
2014-08-15 13:37:15 +10:00
parent 96cf2ceb2c
commit 70c4b52aa0
9 changed files with 289 additions and 599 deletions
+5 -3
View File
@@ -21,13 +21,15 @@
// holds a value of type syscall.Errno.
package windows
import "syscall"
// ByteSliceFromString returns a NUL-terminated slice of bytes
// containing the text of s. If s contains a NUL byte at any
// location, it returns (nil, EINVAL).
// location, it returns (nil, syscall.EINVAL).
func ByteSliceFromString(s string) ([]byte, error) {
for i := 0; i < len(s); i++ {
if s[i] == 0 {
return nil, EINVAL
return nil, syscall.EINVAL
}
}
a := make([]byte, len(s)+1)
@@ -37,7 +39,7 @@ func ByteSliceFromString(s string) ([]byte, error) {
// BytePtrFromString returns a pointer to a NUL-terminated array of
// bytes containing the text of s. If s contains a NUL byte at any
// location, it returns (nil, EINVAL).
// location, it returns (nil, syscall.EINVAL).
func BytePtrFromString(s string) (*byte, error) {
a, err := ByteSliceFromString(s)
if err != nil {