log/syslog: correct message format

The syslog implementation was not correctly implementing the
traditional syslog format because it had a confused notion of
'priority'.  syslog priority is not a single number but is, in
fact, the combination of a facility number and a severity. The
previous Go syslog implementation had a single Priority that
appeared to be the syslog severity and no way of setting the
facility.  That meant that all syslog messages from Go
programs appeared to have a facility of 0 (LOG_KERN) which
meant they all appeared to come from the kernel.

Also, the 'prefix' was in fact the syslog tag (changed the
internal name for clarity as the term tag is more widely used)
and the timestamp and hostname values were missing from
messages.

With this change syslog messages are generated in the correct
format with facility and severity combined into a priority,
the timestamp in RFC3339 format, the hostname, the tag (with
the PID in [] appened) and the message.

The format is now:

   <PRI>1 TIMESTAMP HOSTNAME TAG[PID]: MSG

The TIMESTAMP, HOSTNAME and PID fields are filled in
automatically by the package. The TAG and the MSG are supplied
by the user. This is what rsyslogd calls TraditionalFormat and
should be compatible with multiple systems.

R=rsc, jgc, 0xjnml, mikioh.mikioh, bradfitz
CC=golang-dev
http://codereview.appspot.com/6782118

Committer: Russ Cox <rsc@golang.org>
regexp: add examples

Update issue 4125

R=minux.ma, rsc
CC=golang-dev
http://codereview.appspot.com/6847107

Committer: Russ Cox <rsc@golang.org>
misc/emacs: fix go-mode hang

Fix suggested by serbaut.

Fixes issue 4445.

R=sameer
CC=golang-dev, serbaut
http://codereview.appspot.com/6842102
regexp: add Split

As discussed in issue 2672 and on golang-nuts, this CL adds a Split() method
to regexp. It is based on returning the "opposite" of FindAllString() so that
the returned substrings are everything not matched by the expression.

See: https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/xodBZh9Lh2E

Fixes issue 2762.

R=remyoudompheng, r, rsc
CC=golang-dev
http://codereview.appspot.com/6846048

Committer: Russ Cox <rsc@golang.org>
runtime/race: add test case for issue 4453

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6854103
runtime: use reflect·call() to enter the function gc()

Garbage collection code (to be merged later) is calling functions
which have many local variables. This increases the probability that
the stack capacity won't be big enough to hold the local variables.
So, start gc() on a bigger stack to eliminate a potentially large number
of calls to runtime·morestack().

R=rsc, remyoudompheng, dsymonds, minux.ma, iant, iant
CC=golang-dev
http://codereview.appspot.com/6846044

Committer: Russ Cox <rsc@golang.org>
go/format: Package format implements standard formatting of Go source.

Package format is a utility package that takes care of
parsing, sorting of imports, and formatting of .go source
using the canonical gofmt formatting parameters.

Use go/format in various clients instead of the lower-level components.

R=r, bradfitz, dave, rogpeppe, rsc
CC=golang-dev
http://codereview.appspot.com/6852075
cmd/5g, cmd/8g: fix internal error on 64-bit indices statically bounded

Fixes issue 4448.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6855100
net: consoldate literal target address into IP address functions

This CL continues with introducing IPv6 scoped addressing capability
into the net package.

Update issue 4234.

R=rsc
CC=golang-dev
http://codereview.appspot.com/6842053
net: fix intermittent TestAddFDReturnsError failure

A fix similar to CL 6859043 was effective in resolving the intermittent failure.

Fixes issue 4423.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6854102
net: fix ResolveIPAddr

Fixes misedit in CL 6842053.

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6849115
net: move deadline logic into pollServer

Update issue 4434.

The proposal attempts to reduce the number of places where fd,{r,w}deadline is checked and updated in preparation for issue 4434. In doing so the deadline logic is simplified by letting the pollster return errTimeout from netFD.Wait{Read,Write} as part of the wakeup logic.

The behaviour of setting n = 0 has been restored to match rev 2a55e349097f, which was the previous change to fd_unix.go before CL 6851096.

R=jsing, bradfitz, mikioh.mikioh, rsc
CC=fullung, golang-dev
http://codereview.appspot.com/6850110
net/http: fix broken TestIssue4191_InfiniteGetToPutTimeout

Test creates 2 tcp connections for put and get. Make sure
these are closed properly after test is over, otherwise
server hangs waiting for connection to be closed.

R=golang-dev, bradfitz, dave
CC=golang-dev
http://codereview.appspot.com/6842109
exp/winfsnotify: fix data race in TestNotifyClose

Fixes issue 4342.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6850080
os: include 0111 in directory file mode on windows

Fixes issue 4444.

R=golang-dev, minux.ma, rsc
CC=golang-dev
http://codereview.appspot.com/6858079