Fixes #2798.
R=golang-dev, bradfitz, r, rsc, rsc
CC=golang-dev
https://golang.org/cl/
5642071
<h3 id="encoding_binary">The encoding/binary package</h3>
<p>
-In Go 1, the <code>binary.TotalSize</code> function is renamed
-<a href="/pkg/encoding/binary/#Size"><code>Size</code></a>.
+In Go 1, the <code>binary.TotalSize</code> function has been replaced by
+<a href="/pkg/encoding/binary/#Size"><code>Size</code></a>,
+which takes an <code>interface{}</code> argument rather than
+a <code>reflect.Value</code>.
</p>
<p>
Running <code>go fix</code> will update almost all code affected by the change.
</p>
+<h3 id="log_syslog">The log/syslog package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/log/syslog/#NewLogger"><code>syslog.NewLogger</code></a>
+function returns an error as well as a <code>log.Logger</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
<h3 id="mime">The mime package</h3>
<p>
Running <code>go fix</code> will update almost all code affected by the change.
</p>
+<h3 id="log_syslog">The log/syslog package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/log/syslog/#NewLogger"><code>syslog.NewLogger</code></a>
+function returns an error as well as a <code>log.Logger</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
<h3 id="mime">The mime package</h3>
<p>
return n.conn.Close()
}
-// NewLogger provides an object that implements the full log.Logger interface,
-// but sends messages to Syslog instead; flag is passed as is to Logger;
-// priority will be used for all messages sent using this interface.
-// All messages are logged with priority p.
-func NewLogger(p Priority, flag int) *log.Logger {
+// NewLogger creates a log.Logger whose output is written to
+// the system log service with the specified priority. The logFlag
+// argument is the flag set passed through to log.New to create
+// the Logger.
+func NewLogger(p Priority, logFlag int) (*log.Logger, error) {
s, err := New(p, "")
if err != nil {
- return nil
+ return nil, err
}
- return log.New(s, "", flag)
+ return log.New(s, "", logFlag), nil
}
if skipNetTest(t) {
return
}
- f := NewLogger(LOG_INFO, 0)
+ f, err := NewLogger(LOG_INFO, 0)
if f == nil {
- t.Error("NewLogger() failed")
+ t.Error(err)
}
}