aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/os
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/os')
-rw-r--r--libgo/go/os/dir_plan9.go4
-rw-r--r--libgo/go/os/doc.go2
-rw-r--r--libgo/go/os/error.go2
-rw-r--r--libgo/go/os/exec/exec.go2
-rw-r--r--libgo/go/os/file.go4
-rw-r--r--libgo/go/os/stat_plan9.go2
-rw-r--r--libgo/go/os/types.go6
-rw-r--r--libgo/go/os/user/lookup_unix.go2
8 files changed, 15 insertions, 9 deletions
diff --git a/libgo/go/os/dir_plan9.go b/libgo/go/os/dir_plan9.go
index ebce6d8..060c0b2 100644
--- a/libgo/go/os/dir_plan9.go
+++ b/libgo/go/os/dir_plan9.go
@@ -110,7 +110,7 @@ var nullDir = dir{
}
// Null assigns members of d with special "don't care" values indicating
-// they should not be written by syscall.Wstat.
+// they should not be written by syscall.Wstat.
func (d *dir) Null() {
*d = nullDir
}
@@ -118,7 +118,7 @@ func (d *dir) Null() {
// pdir appends a 9P Stat message based on the contents of Dir d to a byte slice b.
func pdir(b []byte, d *dir) []byte {
n := len(b)
- b = pbit16(b, 0) // length, filled in later
+ b = pbit16(b, 0) // length, filled in later
b = pbit16(b, d.Type)
b = pbit32(b, d.Dev)
b = pqid(b, d.Qid)
diff --git a/libgo/go/os/doc.go b/libgo/go/os/doc.go
index 6a531e0..c469e58 100644
--- a/libgo/go/os/doc.go
+++ b/libgo/go/os/doc.go
@@ -89,7 +89,7 @@ func Hostname() (name string, err error) {
}
// Readdir reads the contents of the directory associated with file and
-// returns an array of up to n FileInfo values, as would be returned
+// returns a slice of up to n FileInfo values, as would be returned
// by Lstat, in directory order. Subsequent calls on the same file will yield
// further FileInfos.
//
diff --git a/libgo/go/os/error.go b/libgo/go/os/error.go
index b88e494..a7977ff 100644
--- a/libgo/go/os/error.go
+++ b/libgo/go/os/error.go
@@ -43,7 +43,7 @@ func NewSyscallError(syscall string, err error) error {
return &SyscallError{syscall, err}
}
-// IsExist returns whether the error is known to report that a file or directory
+// IsExist returns whether the error is known to report that a file or directory
// already exists. It is satisfied by ErrExist as well as some syscall errors.
func IsExist(err error) bool {
return isExist(err)
diff --git a/libgo/go/os/exec/exec.go b/libgo/go/os/exec/exec.go
index c4907cd..8368491 100644
--- a/libgo/go/os/exec/exec.go
+++ b/libgo/go/os/exec/exec.go
@@ -37,7 +37,7 @@ type Cmd struct {
// Args holds command line arguments, including the command as Args[0].
// If the Args field is empty or nil, Run uses {Path}.
- //
+ //
// In typical use, both Path and Args are set by calling Command.
Args []string
diff --git a/libgo/go/os/file.go b/libgo/go/os/file.go
index 4acf35d..32cac6d 100644
--- a/libgo/go/os/file.go
+++ b/libgo/go/os/file.go
@@ -9,7 +9,7 @@
// if a call that takes a file name fails, such as Open or Stat, the error
// will include the failing file name when printed and will be of type
// *PathError, which may be unpacked for more information.
-//
+//
// The os interface is intended to be uniform across all operating systems.
// Features not generally available appear in the system-specific package syscall.
//
@@ -185,7 +185,7 @@ func (f *File) Seek(offset int64, whence int) (ret int64, err error) {
}
// WriteString is like Write, but writes the contents of string s rather than
-// an array of bytes.
+// a slice of bytes.
func (f *File) WriteString(s string) (ret int, err error) {
if f == nil {
return 0, ErrInvalid
diff --git a/libgo/go/os/stat_plan9.go b/libgo/go/os/stat_plan9.go
index 1bc9dd0..b3dd188 100644
--- a/libgo/go/os/stat_plan9.go
+++ b/libgo/go/os/stat_plan9.go
@@ -38,7 +38,7 @@ func fileInfoFromStat(d *dir) FileInfo {
return fs
}
-// arg is an open *File or a path string.
+// arg is an open *File or a path string.
func dirstat(arg interface{}) (d *dir, err error) {
var name string
diff --git a/libgo/go/os/types.go b/libgo/go/os/types.go
index ecb5787..c561ea0 100644
--- a/libgo/go/os/types.go
+++ b/libgo/go/os/types.go
@@ -88,6 +88,12 @@ func (m FileMode) IsDir() bool {
return m&ModeDir != 0
}
+// IsRegular reports whether m describes a regular file.
+// That is, it tests that no mode type bits are set.
+func (m FileMode) IsRegular() bool {
+ return m&ModeType == 0
+}
+
// Perm returns the Unix permission bits in m.
func (m FileMode) Perm() FileMode {
return m & ModePerm
diff --git a/libgo/go/os/user/lookup_unix.go b/libgo/go/os/user/lookup_unix.go
index 5c96408..e0baae2 100644
--- a/libgo/go/os/user/lookup_unix.go
+++ b/libgo/go/os/user/lookup_unix.go
@@ -44,7 +44,7 @@ func bytePtrToString(p *byte) string {
return string(a[:i])
}
-// Current returns the current user.
+// Current returns the current user.
func Current() (*User, error) {
return lookup(syscall.Getuid(), "", false)
}