diff options
author | Robert Griesemer <gri@golang.org> | 2019-02-13 17:00:36 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2019-02-19 20:38:28 +0000 |
commit | fae44a2be350940c3b29919e274e9a7e63f22df7 (patch) | |
tree | f3d6e53516b87298f49abb66c87821e9eda7ebcc /src/archive | |
parent | f8abdd6c8a6bb4882e708f87d1e83ba5f897aeff (diff) | |
download | go-fae44a2be350940c3b29919e274e9a7e63f22df7.tar.gz go-fae44a2be350940c3b29919e274e9a7e63f22df7.zip |
src, misc: apply gofmt
This applies the new gofmt literal normalizations to the library.
Change-Id: I8c1e8ef62eb556fc568872c9f77a31ef236348e7
Reviewed-on: https://go-review.googlesource.com/c/162539
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/archive')
-rw-r--r-- | src/archive/tar/strconv.go | 2 | ||||
-rw-r--r-- | src/archive/tar/strconv_test.go | 42 |
2 files changed, 22 insertions, 22 deletions
diff --git a/src/archive/tar/strconv.go b/src/archive/tar/strconv.go index d144485a49..0a910f33b9 100644 --- a/src/archive/tar/strconv.go +++ b/src/archive/tar/strconv.go @@ -244,7 +244,7 @@ func formatPAXTime(ts time.Time) (s string) { if secs < 0 { sign = "-" // Remember sign secs = -(secs + 1) // Add a second to secs - nsecs = -(nsecs - 1E9) // Take that second away from nsecs + nsecs = -(nsecs - 1e9) // Take that second away from nsecs } return strings.TrimRight(fmt.Sprintf("%s%d.%09d", sign, secs, nsecs), "0") } diff --git a/src/archive/tar/strconv_test.go b/src/archive/tar/strconv_test.go index 4cc388cb0f..dd3505a758 100644 --- a/src/archive/tar/strconv_test.go +++ b/src/archive/tar/strconv_test.go @@ -303,27 +303,27 @@ func TestFormatPAXTime(t *testing.T) { {1350244992, 300000000, "1350244992.3"}, {1350244992, 23960100, "1350244992.0239601"}, {1350244992, 23960108, "1350244992.023960108"}, - {+1, +1E9 - 1E0, "1.999999999"}, - {+1, +1E9 - 1E3, "1.999999"}, - {+1, +1E9 - 1E6, "1.999"}, - {+1, +0E0 - 0E0, "1"}, - {+1, +1E6 - 0E0, "1.001"}, - {+1, +1E3 - 0E0, "1.000001"}, - {+1, +1E0 - 0E0, "1.000000001"}, - {0, 1E9 - 1E0, "0.999999999"}, - {0, 1E9 - 1E3, "0.999999"}, - {0, 1E9 - 1E6, "0.999"}, - {0, 0E0, "0"}, - {0, 1E6 + 0E0, "0.001"}, - {0, 1E3 + 0E0, "0.000001"}, - {0, 1E0 + 0E0, "0.000000001"}, - {-1, -1E9 + 1E0, "-1.999999999"}, - {-1, -1E9 + 1E3, "-1.999999"}, - {-1, -1E9 + 1E6, "-1.999"}, - {-1, -0E0 + 0E0, "-1"}, - {-1, -1E6 + 0E0, "-1.001"}, - {-1, -1E3 + 0E0, "-1.000001"}, - {-1, -1E0 + 0E0, "-1.000000001"}, + {+1, +1e9 - 1e0, "1.999999999"}, + {+1, +1e9 - 1e3, "1.999999"}, + {+1, +1e9 - 1e6, "1.999"}, + {+1, +0e0 - 0e0, "1"}, + {+1, +1e6 - 0e0, "1.001"}, + {+1, +1e3 - 0e0, "1.000001"}, + {+1, +1e0 - 0e0, "1.000000001"}, + {0, 1e9 - 1e0, "0.999999999"}, + {0, 1e9 - 1e3, "0.999999"}, + {0, 1e9 - 1e6, "0.999"}, + {0, 0e0, "0"}, + {0, 1e6 + 0e0, "0.001"}, + {0, 1e3 + 0e0, "0.000001"}, + {0, 1e0 + 0e0, "0.000000001"}, + {-1, -1e9 + 1e0, "-1.999999999"}, + {-1, -1e9 + 1e3, "-1.999999"}, + {-1, -1e9 + 1e6, "-1.999"}, + {-1, -0e0 + 0e0, "-1"}, + {-1, -1e6 + 0e0, "-1.001"}, + {-1, -1e3 + 0e0, "-1.000001"}, + {-1, -1e0 + 0e0, "-1.000000001"}, {-1350244992, 0, "-1350244992"}, {-1350244992, -300000000, "-1350244992.3"}, {-1350244992, -23960100, "-1350244992.0239601"}, |