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

18 Commits

Author SHA1 Message Date
Brad Fitzpatrick
4e8c113793 log/syslog: document that Dial uses net.Dial parameters, add example
Fixes #16761

Change-Id: I709daa87926a31e5f8fd46a4c5ef69718ae349b1
Reviewed-on: https://go-review.googlesource.com/27209
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-08-19 01:01:47 +00:00
Brad Fitzpatrick
5fea2ccc77 all: single space after period.
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/20022
Reviewed-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>
2016-03-02 00:13:47 +00:00
Brad Fitzpatrick
351c15f1ce all: remove public named return values when useless
Named returned values should only be used on public funcs and methods
when it contributes to the documentation.

Named return values should not be used if they're only saving the
programmer a few lines of code inside the body of the function,
especially if that means there's stutter in the documentation or it
was only there so the programmer could use a naked return
statement. (Naked returns should not be used except in very small
functions)

This change is a manual audit & cleanup of public func signatures.

Signatures were not changed if:

* the func was private (wouldn't be in public godoc)
* the documentation referenced it
* the named return value was an interesting name. (i.e. it wasn't
  simply stutter, repeating the name of the type)

There should be no changes in behavior. (At least: none intended)

Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109
Reviewed-on: https://go-review.googlesource.com/20024
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-29 03:31:19 +00:00
Josh Bleecher Snyder
e43c74a0d8 all: use cannot instead of can not
You can not use cannot, but you cannot spell cannot can not.

Change-Id: I2f0971481a460804de96fd8c9e46a9cc62a3fc5b
Reviewed-on: https://go-review.googlesource.com/19772
Reviewed-by: Rob Pike <r@golang.org>
2016-02-21 15:35:50 +00:00
Brad Fitzpatrick
ddc25081d2 log/syslog: document that syslog is frozen
Try to reduce feature request bug reports.

Change-Id: I713bb715d25d23e084b054aea8e1c3197dde90d4
Reviewed-on: https://go-review.googlesource.com/18222
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-05 22:56:07 +00:00
Hyang-Ah Hana Kim
08d04ba2a4 log/syslog: disable unix/unixgram tests on android
unix/unixgram is not available to standard Android programs.

For golang/go#10807

Change-Id: I6062c3a25cffb86e58cbbd12a07dc90ffbf57185
Reviewed-on: https://go-review.googlesource.com/16114
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-10-21 17:56:51 +00:00
Josh Bleecher Snyder
d1e7980d1b log: fix flaky test
Fixes #11272.

Change-Id: I78d666c20f4f7cb7116d37fd66b5f8b7d66c53c4
Reviewed-on: https://go-review.googlesource.com/11234
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-18 18:08:17 +00:00
Shenghou Ma
43618e62ca log/syslog: make the BUG notes visible on golang.org
It was only visible when you run godoc with explicit GOOS=windows,
which is less useful for people developing portable application on
non-windows platforms.

Also added a note that log/syslog is not supported on NaCl.

Change-Id: I81650445fb2a5ee161da7e0608c3d3547d5ac2a6
Reviewed-on: https://go-review.googlesource.com/9245
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-04-22 21:09:53 +00:00
David Crawshaw
b214a88d76 log/syslog: limiting tests on darwin/arm64
Just like darwin/arm.

Change-Id: Ic5c6c0b2fdbb89f4579677e120a8f2dbf300e5b9
Reviewed-on: https://go-review.googlesource.com/8820
Reviewed-by: Minux Ma <minux@golang.org>
2015-04-13 11:54:28 +00:00
Rob Pike
efb9bd5bb1 log: add flag LUTC, to use UTC time zone for time stamp
Issue 9483 suggests several approaches to correlating logs from
machines in different time zones. This approach is the simplest and
really should be sufficient: provide a way to clamp the time stamps
to UTC.

Fixes #9483.

Change-Id: If540b991d758c4d845a719779f8255ece7c452e7
Reviewed-on: https://go-review.googlesource.com/8761
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-04-11 02:30:24 +00:00
Rob Pike
d340b10366 log: logging an empty string should still print a line
Print("") was printing a header but no line.

Fixes #9665.

Change-Id: Iac783187786065e1389ad6e8d7ef02c579ed7bd8
Reviewed-on: https://go-review.googlesource.com/8665
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-04-09 17:02:27 +00:00
David Crawshaw
2587520797 log/syslog: avoid unix sockets on darwin/arm
Change-Id: Ice4f78e74ec3025a974ffd9ca5e3d28bb3164f40
Reviewed-on: https://go-review.googlesource.com/6794
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
2015-03-04 22:13:06 +00:00
Andrew Gerrand
56ba3fb765 log: add SetOutput method on Logger
Fixes #9629

Change-Id: I66091003b97742ca6d857fe51d609833ab727216
Reviewed-on: https://go-review.googlesource.com/3023
Reviewed-by: Rob Pike <r@golang.org>
2015-01-30 16:00:10 +00:00
Rob Pike
86fdcbedbc log: add global Output function
It was just an oversight that this one method of Logger was not
made available for the standard (std) Logger.

Fixes #9183

Change-Id: I2f251becdb0bae459212d09ea0e5e88774d16dea
Reviewed-on: https://go-review.googlesource.com/2686
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-12 04:45:38 +00:00
Martin Möhrmann
a3876ac21c log: optimize itoa
Reduce buffer to maximally needed size for conversion of 64bit integers.
Reduce number of used integer divisions.

benchmark            old ns/op     new ns/op     delta
BenchmarkItoa        144           119           -17.36%
BenchmarkPrintln     783           752           -3.96%

Change-Id: I6d57a7feebf90f303be5952767107302eccf4631
Reviewed-on: https://go-review.googlesource.com/2215
Reviewed-by: Rob Pike <r@golang.org>
2015-01-09 00:22:10 +00:00
Andrew Gerrand
43ce5c0306 log: update doc comment
Fixes #9448.

Change-Id: I8e1d676688d9e9b2fa3519ebc530905f574a1b3e
Reviewed-on: https://go-review.googlesource.com/2088
Reviewed-by: Rob Pike <r@golang.org>
2015-01-05 01:21:52 +00:00
Russ Cox
5a1906dc47 log/syslog: try /var/run/log, for FreeBSD
Fixes #8449.

LGTM=iant
R=golang-codereviews, iant
CC=bradfitz, golang-codereviews
https://golang.org/cl/145600044
2014-09-30 12:30:16 -04:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
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.
2014-09-08 00:08:51 -04:00