浏览代码

unix: fix example

This should call unix.Exec, not syscall.Exec. Thanks Tobias Klauser
for the spot.

Change-Id: Iddae390891a66652b071e05c1a5a25bbfdb19e52
Reviewed-on: https://go-review.googlesource.com/101435
Run-TryBot: Kevin Burke <kev@inburke.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Kevin Burke 7 年之前
父节点
当前提交
d8e400bc7d
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      unix/example_test.go

+ 6 - 3
unix/example_test.go

@@ -2,15 +2,18 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package unix
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+
+package unix_test
 
 import (
 	"log"
 	"os"
-	"syscall"
+
+	"golang.org/x/sys/unix"
 )
 
 func ExampleExec() {
-	err := syscall.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ())
+	err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ())
 	log.Fatal(err)
 }