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

94 Commits

Author SHA1 Message Date
Rémy Oudompheng
c10f50859e all: remove various unused unexported functions and constants.
R=golang-dev, minux.ma, rsc
CC=golang-dev, remy
https://golang.org/cl/5702050
2012-02-28 21:48:03 +01:00
Andrew Gerrand
ce51e10749 archive/zip: use encoding/binary again, add readBuf helper
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5699097
2012-02-28 09:41:30 +11:00
Andrew Gerrand
eb825b58cc archive/zip: use smarter putUintXX functions to hide offsets
R=bradfitz, r, dsymonds, kyle
CC=golang-dev
https://golang.org/cl/5701055
2012-02-27 17:37:59 +11:00
Andrew Gerrand
228f44a1f5 archive/zip: stop using encoding/binary
R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5694085
2012-02-27 16:29:22 +11:00
Andrew Gerrand
3e804f98d7 pkg: a slew of examples
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5676071
2012-02-18 11:48:33 +11:00
Brad Fitzpatrick
7127b6fddc bytes,strings: make *Reader implement io.ReaderAt
R=golang-dev, adg, bradfitz, r
CC=golang-dev
https://golang.org/cl/5675053
2012-02-15 12:58:00 +11:00
Andrew Gerrand
04868b28ac archive/zip: hide Write method from *Writer type
This was an implementation detail that snuck into the public interface.
*Writer.Create gives you an io.Writer, the *Writer itself was never
meant to be written to.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5654076
2012-02-14 10:47:48 +11:00
Nigel Tao
cc9ed447d0 compress: make flate, gzip and zlib's NewWriterXxx functions all return
(*Writer, error) if they take a compression level, and *Writer otherwise.
Rename gzip's Compressor and Decompressor to Writer and Reader, similar to
flate and zlib.

Clarify commentary when writing gzip metadata that is not representable
as Latin-1, and fix io.EOF comment bug.

Also refactor gzip_test to be more straightforward.

Fixes #2839.

R=rsc, r, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5639057
2012-02-10 18:49:19 +11:00
Andrew Gerrand
0a6e2461e3 archive/zip: tweak API and docs.
Fixes #2835.

R=golang-dev, n13m3y3r, r, bradfitz
CC=golang-dev
https://golang.org/cl/5645051
2012-02-08 14:34:40 +11:00
Gustavo Niemeyer
02fb021161 archive/zip: support full range of FileMode flags
Zip files may actually store symlinks, and that's represented
as a file with unix flag S_IFLNK and with its data containing
the symlink target name.

The other flags are being supported too. Now that the os package
has the full range of flags in a system agnostic manner, there's
no reason to discard that information.

R=golang-dev, adg, rogpeppe
CC=golang-dev
https://golang.org/cl/5624048
2012-02-06 11:58:32 -02:00
Gustavo Niemeyer
20f4385af0 os: turn FileStat.Sys into a method on FileInfo
This reduces the overhead necessary to work with OS-specific
file details, hides the implementation of FileStat, and
preserves the implementation-specific nature of Sys.

Expressions such as:

  stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid
  fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat))

Are now spelled as::

  stat.Sys().(*syscall.Stat_t).Uid
  os.SameFile(fi1, fi2)

R=cw, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5448079
2012-02-03 00:16:18 -02:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Brad Fitzpatrick
eb53d472ef doc: use consistent receiver names, when it makes sense.
Makes for prettier docs.

R=golang-dev, dsymonds, r, rsc
CC=golang-dev
https://golang.org/cl/5576056
2012-01-30 11:58:49 -08:00
Brad Fitzpatrick
b62a5099e4 archive/zip: add functions to convert between os.FileInfo & FileHeader
Fixes #2186

R=golang-dev, gri, adg
CC=golang-dev
https://golang.org/cl/5579044
2012-01-26 15:31:09 -08:00
Joel Sing
e3e1804ed2 archive/tar: fix race in TestNonSeekable
Reimplement the test based on code from adg@golang.org.

The previous version has a race since the file is closed via defer
rather than in the go routine. This meant that the file could be
closed before the go routine has actually received io.EOF. It then
receives EBADF and continues to do zero-byte writes to the pipe.

This addresses an issue seen on FreeBSD and OpenBSD, where the test
passes but exits with a SIGPIPE, resulting in a failure.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5554083
2012-01-25 13:44:53 +11:00
Brad Fitzpatrick
37d2f8190d rename FooError vars to ErrFoo
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5574056
2012-01-24 11:48:48 -08:00
Brad Fitzpatrick
315b361f89 zip: fix data race in test
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5492073
2011-12-19 15:40:10 -08:00
Andrew Gerrand
0b28de9a05 archive/zip: add SetModTime method to FileHeader
Fixes #2574.

R=golang-dev, bradfitz, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5494072
2011-12-19 14:59:41 +11:00
Christopher Wedgwood
0e9ee93cea archive/tar: (test) structure comparison not reflect.DeepEqual
R=dsymonds
CC=golang-dev
https://golang.org/cl/5487064
2011-12-14 08:08:49 +11:00
Roger Peppe
2cb1aa4681 archive/zip: make zip understand os.FileMode.
Fixes implicit dependency on underlying os file modes.

R=rsc, r, n13m3y3r, gustavo, adg
CC=golang-dev
https://golang.org/cl/5440130
2011-12-12 15:22:55 -05:00
Russ Cox
2666b815a3 use new strconv API
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Russ Cox
dcf1d7bc0e gofmt -s misc src
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5451079
2011-12-02 14:14:25 -05:00
Robert Griesemer
15a3a5cf6c gofmt: applied gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5451070
2011-12-01 14:33:24 -08:00
Adam Langley
bac7bc55a6 Add a []byte argument to hash.Hash to allow an allocation to be saved.
This is the result of running `gofix -r hashsum` over the tree, changing
the hash function implementations by hand and then fixing a couple of
instances where gofix didn't catch something.

The changed implementations are as simple as possible while still
working: I'm not trying to optimise in this CL.

R=rsc, cw, rogpeppe
CC=golang-dev
https://golang.org/cl/5448065
2011-12-01 12:35:37 -05:00
Russ Cox
8dce57e169 os: new FileInfo, FileMode types + update tree
R=golang-dev, r, r, gri, bradfitz, iant, iant, nigeltao, n13m3y3r
CC=golang-dev
https://golang.org/cl/5416060
2011-11-30 12:04:16 -05:00
Russ Cox
03823b881c use new time API
R=bradfitz, gri, r, dsymonds
CC=golang-dev
https://golang.org/cl/5390042
2011-11-30 12:01:46 -05:00
Rob Pike
30aa701fec renaming_2: gofix -r go1pkgrename src/pkg/[a-l]*
R=rsc
CC=golang-dev
https://golang.org/cl/5358041
2011-11-08 15:40:58 -08:00
Dmitry Chestnykh
ad0e8b31d8 archive/zip: actually close file opened with OpenReader.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5341044
2011-11-07 16:33:53 +11: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
c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Russ Cox
92926f5472 pkg: minor cleanup
remove some redundant .String()
change variable name to make it os.Error-proof

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5302075
2011-10-31 17:53:39 -04:00
David Symonds
39493be294 io: rename Copyn to CopyN.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5157045
2011-09-30 13:13:39 -07:00
Rob Pike
d4507d44a6 archive/zip: fix Fatal call
Error found by govet.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5142048
2011-09-27 09:33:26 -07:00
Gustavo Niemeyer
ecda69e667 archive/zip: read and write unix file modes
R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/5124044
2011-09-25 20:48:03 -03:00
Mike Rosset
b71a805cd5 archive/tar: document Header fields and Type flags
Documentation more along the lines of os.FileInfo
Fixes #2180.

R=golang-dev, dsymonds
CC=golang-dev, mike.rosset
https://golang.org/cl/4958055
2011-09-17 11:43:06 -07:00
Mike Rosset
af8b1271eb archive/tar: when writing tar Headers write hdr.Linkname
This should allow symlinks in tar files. Where previously
as far as I can see they were skipped completely.

R=golang-dev, dsymonds, rsc, bradfitz, bradfitz
CC=golang-dev, mike.rosset
https://golang.org/cl/4973044
2011-08-29 11:01:03 -07:00
Andrew Gerrand
e0b6f4721f archive/zip: more efficient reader and bug fix
Fixes #2090.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4815068
2011-07-29 10:47:00 -07:00
Brad Fitzpatrick
8fdc2851e4 zip: add a test for the previous >65k files fix
This surprisingly takes 30 seconds on my fast machine
so disabling by default. Need to optimize the Writer
at some point.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4815048
2011-07-22 18:30:07 -07:00
Andrew Gerrand
38e5128243 archive/zip: handle zip files with more than 65535 files
R=r
CC=golang-dev
https://golang.org/cl/4812048
2011-07-22 14:57:17 +10:00
Robert Griesemer
98f5fc5e86 archive/zip: support functions to get modified time in ns from MS-DOS time
R=rsc, r, bradfitz, r, adg
CC=golang-dev
https://golang.org/cl/4748056
2011-07-18 20:30:44 -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
Andrew Gerrand
4d47600f46 archive/zip: add Writer
R=bradfitz, dchest, r, rsc
CC=golang-dev
https://golang.org/cl/4523077
2011-07-10 11:30:16 +10: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
Brad Fitzpatrick
bb1ec0dfc8 tar: use ioutil.Discard
This one didn't come up in previous greps.

R=adg
CC=golang-dev
https://golang.org/cl/4430071
2011-04-27 15:57:22 -07:00
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
David Symonds
1de71a07e0 archive/tar: fix example's handling of os.EOF.
Fixes #1677.

R=r
CC=golang-dev
https://golang.org/cl/4402042
2011-04-13 10:56:33 +10:00
Dmitry Chestnykh
1b7142d157 archive/zip: add new type ReadCloser, make OpenReader return it.
Fixes #1678.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4372047
2011-04-10 11:23:23 +10:00
Rob Pike
8a90fd3c72 os: New Open API.
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)

This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)

The interesting packages are:
        gofix
        os
Everything else is automatically generated except for hand tweaks to:
        src/pkg/io/ioutil/ioutil.go
        src/pkg/io/ioutil/tempfile.go
        src/pkg/crypto/tls/generate_cert.go
        src/cmd/goyacc/goyacc.go
        src/cmd/goyacc/units.y

R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052
2011-04-04 23:42:14 -07:00
Brad Fitzpatrick
2be13a80c7 os: add Seek whence constants
R=r, r2, rsc1, rsc, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/4344062
2011-04-04 13:53:52 -07:00