Prechádzať zdrojové kódy

go.sys: fix imports to cgc/p/go.sys, add build tags
Approach but probably not achieve a green build.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/126120043

Rob Pike 11 rokov pred
rodič
commit
279b3782ad

+ 1 - 1
plan9/race.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build race
+// +build plan9,race
 
 package plan9
 

+ 1 - 1
plan9/race0.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !race
+// +build plan9,!race
 
 package plan9
 

+ 2 - 0
plan9/str.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build plan9
+
 package plan9
 
 func itoa(val int) string { // do it here rather than with fmt to avoid dependency

+ 2 - 0
plan9/syscall.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build plan9
+
 // Package plan9 contains an interface to the low-level operating system
 // primitives.  OS details vary depending on the underlying system, and
 // by default, godoc will display the OS-specific documentation for the current

+ 2 - 0
plan9/syscall_test.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build plan9
+
 package plan9_test
 
 import (

+ 2 - 1
unix/creds_test.go

@@ -11,7 +11,8 @@ import (
 	"net"
 	"os"
 	"testing"
-	"unix"
+
+	"code.google.com/p/go.sys/unix"
 )
 
 // TestSCMCredentials tests the sending and receiving of credentials

+ 2 - 0
unix/flock.go

@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build darwin dragonfly freebsd linux netbsd openbsd
+
 package unix
 
 import "unsafe"

+ 1 - 1
unix/mksyscall_solaris.pl

@@ -264,7 +264,7 @@ package $package
 import "unsafe"
 EOF
 
-print "import \"unix\"\n" if $package ne "unix";
+print "import \"code.google.com/p/go.sys/unix\"\n" if $package ne "unix";
 
 print <<EOF;
 

+ 2 - 1
unix/mmap_unix_test.go

@@ -8,7 +8,8 @@ package unix_test
 
 import (
 	"testing"
-	"unix"
+
+	"code.google.com/p/go.sys/unix"
 )
 
 func TestMmap(t *testing.T) {

+ 1 - 1
unix/race.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build race
+// +build darwin,race dragonfly,race freebsd,race linux,race netbsd,race openbsd,race
 
 package unix
 

+ 1 - 1
unix/race0.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !race
+// +build darwin,!race dragonfly,!race freebsd,!race linux,!race netbsd,!race openbsd,!race
 
 package unix
 

+ 2 - 0
unix/str.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build darwin dragonfly freebsd linux netbsd openbsd
+
 package unix
 
 func itoa(val int) string { // do it here rather than with fmt to avoid dependency

+ 2 - 0
unix/syscall.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build darwin dragonfly freebsd linux netbsd openbsd
+
 // Package unix contains an interface to the low-level operating system
 // primitives.  OS details vary depending on the underlying system, and
 // by default, godoc will display OS-specific documentation for the current

+ 2 - 1
unix/syscall_bsd_test.go

@@ -8,7 +8,8 @@ package unix_test
 
 import (
 	"testing"
-	"unix"
+
+	"code.google.com/p/go.sys/unix"
 )
 
 const MNT_WAIT = 1

+ 4 - 1
unix/syscall_test.go

@@ -2,11 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build darwin dragonfly freebsd linux netbsd openbsd
+
 package unix_test
 
 import (
 	"testing"
-	"unix"
+
+	"code.google.com/p/go.sys/unix"
 )
 
 func testSetGetenv(t *testing.T, key, value string) {

+ 2 - 1
unix/syscall_unix_test.go

@@ -17,7 +17,8 @@ import (
 	"runtime"
 	"testing"
 	"time"
-	"unix"
+
+	"code.google.com/p/go.sys/unix"
 )
 
 // Tests that below functions, structures and constants are consistent

+ 1 - 1
windows/mksyscall_windows.go

@@ -661,7 +661,7 @@ const srcTemplate = `
 package {{packagename}}
 
 import "unsafe"{{if windowsdot}}
-import "windows"{{end}}
+import "code.google.com/p/go.sys/windows"{{end}}
 
 var (
 {{template "dlls" .}}

+ 1 - 1
windows/race.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build race
+// +build windows,race
 
 package windows
 

+ 1 - 1
windows/race0.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !race
+// +build windows,!race
 
 package windows
 

+ 2 - 0
windows/str.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build windows
+
 package windows
 
 func itoa(val int) string { // do it here rather than with fmt to avoid dependency

+ 2 - 0
windows/syscall.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build windows
+
 // Package windows contains an interface to the low-level operating system
 // primitives.  OS details vary depending on the underlying system, and
 // by default, godoc will display the OS-specific documentation for the current

+ 4 - 1
windows/syscall_test.go

@@ -2,11 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build windows
+
 package windows_test
 
 import (
 	"testing"
-	"windows"
+
+	"code.google.com/p/go.sys/windows"
 )
 
 func testSetGetenv(t *testing.T, key, value string) {

+ 2 - 1
windows/syscall_windows_test.go

@@ -9,7 +9,8 @@ import (
 	"os"
 	"path/filepath"
 	"testing"
-	"windows"
+
+	"code.google.com/p/go.sys/windows"
 )
 
 func TestWin32finddata(t *testing.T) {