An error occurred fetching the project authors.
- 26 Feb, 2019 1 commit
-
-
Russ Cox authored
This CL updates fmt's scanner to accept the new number syntaxes: - Hexadecimal floating-point values. - Digit-separating underscores. - Leading 0b and 0o prefixes. See golang.org/design/19308-number-literals for background. For #12711. For #19308. For #28493. For #29008. Change-Id: I5582af5c94059c781e6cf4e862441d3df3006adf Reviewed-on: https://go-review.googlesource.com/c/160247Reviewed-by:
Robert Griesemer <gri@golang.org>
-
- 07 Oct, 2016 2 commits
-
-
Russ Cox authored
This CL makes minor adjustment to the handling of spaces and newlines and then documents the result. The semantic adjustment mainly concerns the handling of a run of spaces following a newline in the format, like in "\n ". Previously, that run of spaces was ignored entirely, leading to paradoxes like the format "1 \n 2" not matching itself as input. Now, spaces following a newline in the format match zero or more spaces following the corresponding newline in the input. The changes to the test suite show how minor the semantic adjustments are and how they make the behavior more regular than previously. This CL also updates the documentation to explain the handling of spaces more precisely, incorporating the draft from CL 17723 but describing the newly introduced behavior. Fixes #13565. Change-Id: I129666e9ba42de3c28b67f75cb47488e9a4c1867 Reviewed-on: https://go-review.googlesource.com/30611Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
There are no semantic changes here, just tests to establish the status quo. A followup CL will make some semantic changes, the (limited) scope of which should be clear from the number of tests that change. For #13565. Change-Id: I960749cf59d4dfe39c324875bcc575096654f883 Reviewed-on: https://go-review.googlesource.com/30610 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Rob Pike <r@golang.org>
-
- 16 Jul, 2016 1 commit
-
-
Joe Tsai authored
Change https://golang.org/cl/19895 caused a regression where the last character in a string would be dropped if it was accompanied by an io.EOF. This change fixes the logic so that the last byte is still returned without a problem. Fixes #16393 Change-Id: I7a4d0abf761c2c15454136a79e065fe002d736ea Reviewed-on: https://go-review.googlesource.com/24981Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 21 Mar, 2016 1 commit
-
-
Dominik Honnef authored
This deletes unused code and helpers from tests. Change-Id: Ie31d46115f558ceb8da6efbf90c3c204e03b0d7e Reviewed-on: https://go-review.googlesource.com/20927Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 02 Mar, 2016 1 commit
-
-
Brad Fitzpatrick authored
The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022Reviewed-by:
Rob Pike <r@golang.org> Reviewed-by:
Dave Day <djd@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 26 Feb, 2016 1 commit
-
-
Martin Möhrmann authored
All io.Reader that are passed to newScanState in all the standard library tests that implement io.RuneReader also implement io.RuneScanner. Do not check on each call ScanState's UnreadRune that the used RuneReader also implements the UnreadRune method by using a private interface. Instead require the used Reader to implement the public RuneScanner interface. The extra implementation logic for UnreadRune is removed from ScanState. Instead the readRune wrapper is extended to implement UnreadRune for the RuneScanner interface. If the Reader passed to newScanstate does not implement RuneScanner the readRune wrapper is used to implement the missing functionality. Note that a RuneReader that does not implement RuneScanner will also be wrapped by runeRead which was not the case before. Performance with the readRune wrapper is better than without before. Add benchmark to compare performance with and without using the readRune wrapper. name old time/op new time/op delta ScanInts-2 704µs ± 0% 615µs ± 1% -12.73% (p=0.000 n=20+20) ScanRecursiveInt-2 82.6ms ± 0% 51.4ms ± 0% -37.71% (p=0.000 n=20+20) ScanRecursiveIntReaderWrapper-2 85.1ms ± 0% 52.4ms ± 0% -38.36% (p=0.000 n=20+20) Change-Id: I8c6e85db9b87a8171caab12f020b6e256b498e81 Reviewed-on: https://go-review.googlesource.com/19895 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Rob Pike <r@golang.org>
-
- 19 Feb, 2016 1 commit
-
-
Nathan VanBenschoten authored
Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a Reviewed-on: https://go-review.googlesource.com/18120Reviewed-by:
Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
-
- 11 Dec, 2015 1 commit
-
-
Russ Cox authored
This change can break real code. There are other newline-related bugs in this code, and fixing them will also break real code. If we're going to break real code, let's fix all the bugs together and just break things once. This reverts commit 8331f19d. Change-Id: Ie4b3022f3a305c3e1f78cc208e50beed212608e6 Reviewed-on: https://go-review.googlesource.com/17724Reviewed-by:
Rob Pike <r@golang.org>
-
- 23 Nov, 2015 1 commit
-
-
Nodir Turakulov authored
Sscanf doc says: Newlines in the input must match newlines in the format. However Sscanf didn't check newline in the end of input (EOF). A test for the case is broken. * check newline in EOF * fix the test * slightly simplify ss.doScanf Fixes #12788 Change-Id: Iaf6b7d81324a72e557543ac22ecea5cecb72e0d6 Reviewed-on: https://go-review.googlesource.com/16165 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Rob Pike <r@golang.org>
-
- 20 Nov, 2015 1 commit
-
-
Rob Pike authored
Previously it said, "bad verb %% for ...", which is not only wrong, it's ironic as the fix is to use %% rather than % at the end of the string. Diagnose the case where a simple % is at EOF. If there's anything after the percent, the error is already good but this CL also puts quotes around the verb designation ('%d' etc.) to make it even clearer, especially when there is a space involved. Fixes #12315. Change-Id: I31d30659965e940d0bd9ce92a475aab3e2369ef0 Reviewed-on: https://go-review.googlesource.com/17150Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 20 Oct, 2015 1 commit
-
-
Thorben Krueger authored
For printing, the format verb '%X' results in a capitalized hex-representation of the formatted value. Conversely, using '%X' in a Scanf function should scan a hex-representation into the given interface{}. The existing implementation however only supports '%X' for scanning hex values into integers; strings or byte slices remain empty. On the other hand, lower-case '%x' supports strings and byte slices just fine. This is merely an oversight, which this commit fixes. (Additional tests also included.) Fixes #12940 Change-Id: I178a7f615bae950dfc014ca8c0a038448cf0452a Reviewed-on: https://go-review.googlesource.com/15689Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 24 Aug, 2015 1 commit
-
-
Rob Pike authored
In short, %c should just give you the next rune, period. Apparently this is the design. I use the term loosely. Fixes #12275 Change-Id: I6f30bed442c0e88eac2244d465c7d151b29cf393 Reviewed-on: https://go-review.googlesource.com/13821Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 10 Aug, 2015 1 commit
-
-
Rob Pike authored
When scanning a hex byte at EOF, the code was ungetting the eof, which backed up the input and caused double-scanning of a byte. Delete the call to UnreadRune. This line appeared in 1.5 for some reason; it was not in 1.4 and should be removed again for 1.5 Fixes #12090. Change-Id: Iad1ce8e7db8ec26615c5271310f4b0228cca7d78 Reviewed-on: https://go-review.googlesource.com/13461Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 13 Jun, 2015 1 commit
-
-
Rob Pike authored
When scanning with a width, as in %5s, C skips leading spaces brefore counting the 5 characters. We should do the same. Reword the documentation about widths to make this clear. Fixes #9444 Change-Id: I443a6441adcf1c834057ef3977f9116a987a79cd Reviewed-on: https://go-review.googlesource.com/10997Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 12 Jun, 2015 1 commit
-
-
Rob Pike authored
The documentation says that newlines behave like this: Scan etc.: newlines are spaces. Scanln etc.: newlines terminate the scan. Scanf etc.: newlines must match in input and format. The code did not implement this behavior in all cases, especially for Scanf. Make it behave: - Fix the handling of spaces and newlines in ss.Advance. The code is longer but now behaves as it should. - Delete the reuse of the current ss in newScanState. There is really no need, since it's only used in recursive calls to Scan etc., and the flags are likely wrong. Simpler just to allocate a new one every time, and likelier to be correct. Fixes #10862. Change-Id: If060ac021017346723b0d62de4e5a305da898f68 Reviewed-on: https://go-review.googlesource.com/10991Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 22 Dec, 2014 1 commit
-
-
Rob Pike authored
Couldn't handle a hex string terminated by anything other than spaces. Easy to fix. Fixes #9124. Change-Id: I18f89a0bd99a105c9110e1ede641873bf9daf3af Reviewed-on: https://go-review.googlesource.com/1538Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 08 Sep, 2014 1 commit
-
-
Russ Cox authored
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
-
- 15 Aug, 2014 1 commit
-
-
Rob Pike authored
Fixes #8512. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/130090043
-
- 02 Aug, 2013 1 commit
-
-
Rob Pike authored
Includes deleting some unused items. R=golang-dev, adg CC=golang-dev https://golang.org/cl/12305043
-
- 31 Jul, 2013 1 commit
-
-
Rob Pike authored
When scanning input and "white space" is permitted, a carriage return followed immediately by a newline (\r\n) is treated exactly the same as a plain newline (\n). I hope this makes it work better on Windows. We do it everywhere, not just on Windows, since why not? Fixes #5391. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12142043
-
- 22 Jan, 2013 1 commit
-
-
Robin Eklind authored
R=minux.ma, dave, rsc CC=golang-dev https://golang.org/cl/7064055
-
- 11 Jun, 2012 1 commit
-
-
Rob Pike authored
Makes interactive uses work line-by-line. Fixes #3481. R=golang-dev, bradfitz, r CC=golang-dev https://golang.org/cl/6297075
-
- 13 Mar, 2012 1 commit
-
-
Shenghou Ma authored
Also fix a typo in comment. R=golang-dev, r, r CC=golang-dev https://golang.org/cl/5808043
-
- 09 Feb, 2012 1 commit
-
-
Rob Pike authored
Fixes bug 2922. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5642072
-
- 09 Dec, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5448091
-
- 14 Nov, 2011 1 commit
-
-
Russ Cox authored
Also update Scanf tests to cope with DeepEqual distinguishing empty vs nil slice. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5375091
-
- 08 Nov, 2011 1 commit
-
-
Rob Pike authored
R=rsc CC=golang-dev https://golang.org/cl/5358041
-
- 02 Nov, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
-
- 26 Oct, 2011 1 commit
-
-
Russ Cox authored
Lots of internal edits. Formatter and Scanner interfaces change (clients to be checked by govet). R=r CC=golang-dev https://golang.org/cl/5305045
-
- 18 Jul, 2011 1 commit
-
-
Rob Pike authored
It took it as an octal base prefix but assumed more digits were coming. Fixes #2077. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4764044
-
- 22 Jun, 2011 1 commit
-
-
Robert Griesemer authored
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
-
- 02 Jun, 2011 1 commit
-
-
Rob Pike authored
Fixes #1840. R=rsc CC=golang-dev https://golang.org/cl/4548077
-
- 25 Apr, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/4435067
-
- 22 Apr, 2011 1 commit
-
-
Ian Lance Taylor authored
This permits the test to run when using gccgo on system without split-stack support. See http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01420.html http://gcc.gnu.org/PR48553 R=r CC=golang-dev https://golang.org/cl/4440062
-
- 08 Apr, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/4353043
-
- 09 Mar, 2011 1 commit
-
-
Roger Peppe authored
When writing custom scanners, I found that Token itself was rarely useful, as I did not always want to stop at white space. This change makes it possible to stop at any class of characters while reusing the buffer within State. (also fix a bug in Token) R=r, r2 CC=golang-dev https://golang.org/cl/4243055
-
- 08 Mar, 2011 1 commit
-
-
Rob Pike authored
While we're on govet, fix a couple of mistakes in a test. Fixes #1592. R=rsc CC=golang-dev https://golang.org/cl/4239071
-
- 06 Mar, 2011 1 commit
-
-
Robert Hencke authored
R=golang-dev, bradfitzgo CC=golang-dev https://golang.org/cl/4235052
-
- 03 Mar, 2011 1 commit
-
-
Roger Peppe authored
Detect when scan is being called recursively and re-use the same scan state. On my machine, for a recursion-heavy benchmark, this results in 44x speed up. This does impose a 4% penalty on the non-recursive case, which can be removed by heap-allocating the saved state, at 40% performance penalty on the recursive case. Either way is fine with me. R=r CC=golang-dev https://golang.org/cl/4253049
-