go.sys: update package names

Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
This commit is contained in:
Rob Pike
2014-08-11 15:58:26 -07:00
parent 20acc5cf31
commit 8442dd2c63
214 changed files with 372 additions and 825 deletions
+10 -10
View File
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall_test
package windows_test
import (
"io/ioutil"
"os"
"path/filepath"
"syscall"
"testing"
"windows"
)
func TestWin32finddata(t *testing.T) {
@@ -27,7 +27,7 @@ func TestWin32finddata(t *testing.T) {
f.Close()
type X struct {
fd syscall.Win32finddata
fd windows.Win32finddata
got byte
pad [10]byte // to protect ourselves
@@ -35,12 +35,12 @@ func TestWin32finddata(t *testing.T) {
var want byte = 2 // it is unlikely to have this character in the filename
x := X{got: want}
pathp, _ := syscall.UTF16PtrFromString(path)
h, err := syscall.FindFirstFile(pathp, &(x.fd))
pathp, _ := windows.UTF16PtrFromString(path)
h, err := windows.FindFirstFile(pathp, &(x.fd))
if err != nil {
t.Fatalf("FindFirstFile failed: %v", err)
}
err = syscall.FindClose(h)
err = windows.FindClose(h)
if err != nil {
t.Fatalf("FindClose failed: %v", err)
}
@@ -55,16 +55,16 @@ func abort(funcname string, err error) {
}
func ExampleLoadLibrary() {
h, err := syscall.LoadLibrary("kernel32.dll")
h, err := windows.LoadLibrary("kernel32.dll")
if err != nil {
abort("LoadLibrary", err)
}
defer syscall.FreeLibrary(h)
proc, err := syscall.GetProcAddress(h, "GetVersion")
defer windows.FreeLibrary(h)
proc, err := windows.GetProcAddress(h, "GetVersion")
if err != nil {
abort("GetProcAddress", err)
}
r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)
r, _, _ := windows.Syscall(uintptr(proc), 0, 0, 0, 0)
major := byte(r)
minor := uint8(r >> 8)
build := uint16(r >> 16)