1
0
mirror of https://github.com/golang/go synced 2024-10-04 08:31:22 -06:00
Commit Graph

222 Commits

Author SHA1 Message Date
Russ Cox
c69d6345da os: make ReadAt comment clearer
Fixes #2486.

R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/5417064
2011-11-22 12:22:28 -05:00
Joel Sing
ea2c0cd88f os: re-enable hostname test on openbsd
Now that Sysctl() works, re-enable the hostname test.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5408042
2011-11-18 01:53:07 +11:00
Lucio De Re
087a34869a syscall, os, time: fix Plan 9 build
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5371092
2011-11-16 17:37:54 -05:00
Russ Cox
3a6744d890 os: fix comment per CL 5370091
Made the edit in the wrong client before submitting.

TBR=r
CC=golang-dev
https://golang.org/cl/5374091
2011-11-15 14:54:00 -05:00
Russ Cox
86a6995a7e os: fix windows build
TBR=brainman
CC=golang-dev
https://golang.org/cl/5373105
2011-11-15 14:05:18 -05:00
Alex Brainman
0d37998a06 syscall: make windows build again after d3963c0fca78 change
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5373097
2011-11-15 12:48:22 -05:00
Russ Cox
d03611f628 allow copy of struct containing unexported fields
An experiment: allow structs to be copied even if they
contain unexported fields.  This gives packages the
ability to return opaque values in their APIs, like reflect
does for reflect.Value but without the kludgy hacks reflect
resorts to.

In general, we trust programmers not to do silly things
like *x = *y on a package's struct pointers, just as we trust
programmers not to do unicode.Letter = unicode.Digit,
but packages that want a harder guarantee can introduce
an extra level of indirection, like in the changes to os.File
in this CL or by using an interface type.

All in one CL so that it can be rolled back more easily if
we decide this is a bad idea.

Originally discussed in March 2011.
https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef

R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
CC=golang-dev
https://golang.org/cl/5372095
2011-11-15 12:20:59 -05:00
Russ Cox
0acd879c26 syscall: take over env implementation
The environment is needed by package time, which
we want not to depend on os (so that os can use
time.Time), so push down into syscall.

Delete syscall.Sleep, now unnecessary.

The package os environment API is preserved;
it is only the implementation that is moving to syscall.

Delete os.Envs, which was undocumented,
uninitialized on Windows and Plan 9, and
not maintained by Setenv and Clearenv.
Code can call os.Environ instead.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5370091
2011-11-14 14:06:50 -05:00
Russ Cox
c017a8299f syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
  return Errno, not uintptr
- syscall wrappers all return error, not uintptr.

R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
2011-11-13 22:44:52 -05:00
Scott Lawrence
6c10aa19b8 os/exec: Fix documentation references to os.DevNull
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5372049
2011-11-09 13:50:13 -08:00
Rob Pike
45e3bcb343 renaming_3: gofix -r go1pkgrename src/pkg/[m-z]*
R=rsc
CC=golang-dev
https://golang.org/cl/5345045
2011-11-08 15:41:54 -08:00
Rob Pike
6ab6c49fce renaming_1: hand-edited files for go 1 renaming
This contains the files that required handiwork, mostly
Makefiles with updated TARGs, plus the two packages
with modified package names.
html/template/doc.go needs a separate edit pass.
test/fixedbugs/bug358.go is not legal go so gofix fails on it.

R=rsc
CC=golang-dev
https://golang.org/cl/5340050
2011-11-08 15:38:47 -08:00
Anthony Martin
cabe0e6ad3 os, syscall: fix Plan 9 build
R=rsc
CC=golang-dev
https://golang.org/cl/5330067
2011-11-08 09:06:02 -05:00
Rob Pike
37d82c8520 os,text,unicode: renamings
This is Go 1 package renaming CL #4.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into os, text, and unicode.

exec -> os/exec
scanner -> text/scanner
tabwriter -> text/tabwriter
template -> text/template
template/parse -> text/template/parse
utf16 -> unicode/utf16
utf8 -> unicode/utf8

This should be the last of the source-rearranging CLs.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5331066
2011-11-03 14:18:06 -07:00
Vincent Vanackere
eb1717e035 all: rename os.EOF to io.EOF in various non-code contexts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5334050
2011-11-03 14:01:30 -07:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
492098eb75 all: rename os.Error to error in various non-code contexts
R=adg
CC=golang-dev
https://golang.org/cl/5328062
2011-11-01 22:58:09 -04:00
Russ Cox
abd3260990 os: fixes for error (plan9)
The Plan 9 build stops in runtime,
but might as well fix these anyway.

R=adg
CC=golang-dev
https://golang.org/cl/5336045
2011-11-01 22:19:40 -04:00
Russ Cox
f1b64aa758 os, syscall: update for error
R=adg
CC=golang-dev
https://golang.org/cl/5333052
2011-11-01 22:12:41 -04:00
Russ Cox
eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox
08a073a180 os: use error, io.EOF
R=r
CC=golang-dev
https://golang.org/cl/5298073
2011-11-01 21:49:08 -04:00
Russ Cox
4853c51770 os: do not interpret 0-length read as EOF
Fixes #2402.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5298081
2011-11-01 00:17:05 -04:00
Mikio Hara
e13635c1e0 os/inotify: move to exp/inotify
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5295044
2011-10-19 10:54:45 +09:00
Russ Cox
313c8224d5 gofix -r mapdelete
R=golang-dev, r, adg, r, cw
CC=golang-dev
https://golang.org/cl/5266045
2011-10-18 09:56:34 -04:00
Christopher Wedgwood
707e5acd71 updates: append(y,[]byte(z)...) -> append(y,z...)"
(more are possible but omitted for now as they are part of
specific tests where rather than changing what is there we
should probably expand the tests to cover the new case)

R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5247058
2011-10-12 13:42:04 -07:00
Russ Cox
2715956f13 build: add build comments to core packages
The go/build package already recognizes
system-specific file names like

        mycode_darwin.go
        mycode_darwin_386.go
        mycode_386.s

However, it is also common to write files that
apply to multiple architectures, so a recent CL added
to go/build the ability to process comments
listing a set of conditions for building.  For example:

        // +build darwin freebsd openbsd/386

says that this file should be compiled only on
OS X, FreeBSD, or 32-bit x86 OpenBSD systems.

These conventions are not yet documented
(hence this long CL description).

This CL adds build comments to the multi-system
files in the core library, a step toward making it
possible to use go/build to build them.

With this change go/build can handle crypto/rand,
exec, net, path/filepath, os/user, and time.

os and syscall need additional adjustments.

R=golang-dev, r, gri, r, gustavo
CC=golang-dev
https://golang.org/cl/5011046
2011-09-15 16:48:57 -04:00
Ian Lance Taylor
096f3a293e os: Fix comment in generated signal_unix.go file.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5013042
2011-09-13 09:38:08 -07:00
Jaroslavas Počepko
571d3f50d3 os: os.RemoveAll has to check for 2 error codes on Windows. ENOENT is not enough.
os.Lstat can return ENOTDIR as well.

R=golang-dev, r, alex.brainman
CC=golang-dev, rsc
https://golang.org/cl/4984051
2011-09-08 17:27:41 +10:00
Alex Brainman
37f390aa20 os: use GetFileAttributesEx to implement Stat on windows
Fixes #2129.

R=rsc
CC=golang-dev
https://golang.org/cl/4934049
2011-09-06 09:59:08 +10:00
Gustavo Niemeyer
1952eb5010 os: fix WNOHANG Waitmsg
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4962042
2011-08-29 10:45:37 -04:00
Joel Sing
a9fe3a0ce3 os: disable Hostname test on OpenBSD
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4901054
2011-08-22 23:24:16 -04:00
Fazlul Shahriar
95aea24990 build: build more packages/commands for Plan 9
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4921041
2011-08-22 11:03:17 +10:00
Russ Cox
c02423902d build: allow builds without cgo
R=bradfitz, dsymonds, fshahriar
CC=golang-dev
https://golang.org/cl/4859043
2011-08-10 21:36:48 -04:00
Joel Sing
604b91a43e os: add support for openbsd
R=rsc
CC=golang-dev
https://golang.org/cl/4798061
2011-08-08 09:56:36 -04:00
Brad Fitzpatrick
bf768294ed os: point readers at the exec package
R=golang-dev, evan, rsc
CC=golang-dev
https://golang.org/cl/4802046
2011-07-20 11:38:18 -07:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Yuval Pavel Zholkover
0bf36ce8fb os: Plan 9: add Process.Signal as a way to send notes.
Move the Signal interface from exec_posix.go to exec.go.
Remove some unsused code from file_plan9.go.

R=fshahriar, rsc
CC=golang-dev
https://golang.org/cl/4683044
2011-07-13 16:29:37 -07:00
Brad Fitzpatrick
d53385fd0c os: don't permit Process.Signal after a successful Wait
R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4689043
2011-07-11 15:47:42 -07:00
Rob Pike
07c9a92564 os: fix documentation for FileInfo.Name.
It's the base name, not the full name.
Fixes #2047.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4680041
2011-07-07 16:05:38 +10:00
Alex Brainman
e71fc0c1fe syscall: rearrange windows code so 386 and amd64 can share files
R=golang-dev, r
CC=golang-dev, vcc.163
https://golang.org/cl/4641093
2011-07-07 10:40:45 +10:00
Fazlul Shahriar
bedee318d5 os: fix build for Plan 9
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4657074
2011-07-05 16:01:29 +10:00
Wei Guangjing
63b8b948d9 windows: define and use syscall.Handle
Fixes #1487.

R=rsc, alex.brainman, go.peter.90, mikioh.mikioh, mattn.jp
CC=golang-dev
https://golang.org/cl/4600042
2011-07-01 10:18:07 -04:00
David Symonds
ba8e61d833 os: use a different symbol from syscall in mkunixsignals.sh.
Open is more likely to be present than Syscall.

R=rsc
CC=golang-dev
https://golang.org/cl/4645073
2011-06-30 13:35:40 +10:00
Rob Pike
f71153278a os: simplify WriteString
It was working too hard.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4639081
2011-06-28 11:09:21 +10:00
Robert Hencke
7a471eadcc os: remove duplicate package description
file.go contains a more complete package description.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4645058
2011-06-24 11:23:49 -07:00
Yasuhiro Matsumoto
8ab2c98972 os: fixed PathListSeparator to ';' for windows.
Fixed issue 1992

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4661047
2011-06-24 15:00:59 +10:00
Brad Fitzpatrick
5dfdccf2b0 Fix Windows build; ErrorString->NewError
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4634080
2011-06-22 11:33:30 -07:00
Robert Griesemer
712fb6dcd3 os.Error API: don't export os.ErrorString, use os.NewError consistently
This is a core API change.

1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
   gob/decode.go
   rpc/client.go
   os/error.go
   io/io.go
   bufio/bufio.go
   http/request.go
   websocket/client.go
as well as:
   src/cmd/gofix/testdata/*.go.in (reverted)
   test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)

Compiles and runs all tests.

R=r, rsc, gri
CC=golang-dev
https://golang.org/cl/4607052
2011-06-22 10:52:47 -07:00
Graham Miller
cf201ed6a0 os: change Waitmsg String method to use pointer receiver
Fixes #1851.

R=rsc
CC=golang-dev
https://golang.org/cl/4628045
2011-06-20 15:42:17 -04:00
Anthony Martin
20943baed3 exec: add support for Plan 9
R=paulzhol, mirtchovski, fshahriar, alex.brainman, r
CC=golang-dev
https://golang.org/cl/4386041
2011-06-20 13:34:10 +10:00