weekly.2011-12-02

163 views
Skip to first unread message

Andrew Gerrand

unread,
Dec 1, 2011, 5:50:52 PM12/1/11
to golang-nuts
We've just tagged a new Go weekly, weekly.2011-12-02. As usual, you
can update by running:
hg pull
hg update weekly

This weekly snapshot includes changes to the hash package and a gofix for the
time and os.FileInfo changes in the last snapshot.

The hash.Hasher's Sum method has been given a []byte argument, permitting
the user to hash an arbitrary byte slice without Writing to the Hasher.
Existing code that uses Sum can pass nil as the argument.
Gofix will make this change automatically.

Other changes:
* crypto/tls: cleanup certificate load on windows (thanks Alex Brainman).
* exp/ssh: add Std{in,out,err}Pipe methods to Session (thanks Dave Cheney).
* dashboard: don't choke on weird builder names.
* exp/ssh: export type signal, now Signal (thanks Gustav Paul).
* os: add ModeType constant to mask file type bits (thanks Gustavo Niemeyer).
* text/template: replace Add with AddParseTree.
* go/doc: detect headings and format them in html (thanks Volker Dobler).

Apologies if we missed anyone in the list above. We appreciate all your help.

To see a full list of changes between this and the previous weekly,
after updating, run:
hg log -r weekly.2011-12-01:weekly.2011-12-02

Enjoy.

Andrew

Gustavo Niemeyer

unread,
Dec 1, 2011, 6:55:00 PM12/1/11
to Andrew Gerrand, golang-nuts
> We've just tagged a new Go weekly, weekly.2011-12-02. As usual, you
> can update by running:

Thanks Andrew.

This release is already available in the Ubuntu PPA for the last 4
Ubuntu releases and for the next one (12.04):

https://wiki.ubuntu.com/Go

Use the golang-weekly package name if you want to follow the weeklies.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I'm not absolutely sure of anything.

Paddy Foran

unread,
Dec 1, 2011, 8:42:34 PM12/1/11
to Gustavo Niemeyer, golang-nuts
I've been so conditioned by poor package maintenance to build from source, it's great to see that Ubuntu's repositories have even Go weekly available. Awesome.

Thanks,
Paddy Foran

Andrew Gerrand

unread,
Dec 1, 2011, 9:36:05 PM12/1/11
to golan...@googlegroups.com
On Friday, December 2, 2011 9:50:52 AM UTC+11, Andrew Gerrand wrote:

The hash.Hasher's Sum method has been given a []byte argument, permitting
the user to hash an arbitrary byte slice without Writing to the Hasher.

This is incorrect. A correct summary of the change is:

  The hash.Hash's Sum method has been given a []byte argument,
  permitting the user to append the hash to an existing byte slice.

Andrew

Paul Sbarra

unread,
Dec 1, 2011, 10:01:59 PM12/1/11
to golang-nuts
This weekly fails for me...

uname -a
Linux MObile 3.1.3-1-ARCH #1 SMP PREEMPT Sun Nov 27 21:08:51 CET 2011
x86_64 AMD Athlon(tm) II Neo K125 Processor AuthenticAMD GNU/Linux

Please let me know what additional info I can provide to help
troubleshoot.

....
test net/mail
TEST FAIL net/mail
make[1]: Entering directory `/home/paul/src/go/src/pkg/net/mail'
gotest -test.short -test.timeout=120
rm -f _test/net/mail.a
6g -p net/mail -o _gotest_.6 message.go message_test.go
rm -f _test/net/mail.a
gopack grc _test/net/mail.a _gotest_.6
--- FAIL: mail.TestDateParsing (0.00 seconds)
message_test.go:109: Parse of "Fri, 21 Nov 1997 09:55:06 -0600": got
Fri Nov 21 09:55:06 -0600 CST 1997, want Fri Nov 21 09:55:06 -0600
-0600 1997
FAIL
gotest: "./6.out -test.short=true -test.timeout=120" failed: exit
status 1
make[1]: *** [testshort] Error 2

Andrew Gerrand

unread,
Dec 2, 2011, 12:39:34 AM12/2/11
to golan...@googlegroups.com
On Friday, December 2, 2011 2:01:59 PM UTC+11, Paul Sbarra wrote:
This weekly fails for me...

uname -a
Linux MObile 3.1.3-1-ARCH #1 SMP PREEMPT Sun Nov 27 21:08:51 CET 2011
x86_64 AMD Athlon(tm) II Neo K125 Processor AuthenticAMD GNU/Linux

--- FAIL: mail.TestDateParsing (0.00 seconds)


message_test.go:109: Parse of "Fri, 21 Nov 1997 09:55:06 -0600": got
Fri Nov 21 09:55:06 -0600 CST 1997, want Fri Nov 21 09:55:06 -0600
-0600 1997
FAIL

Looks like the test in the mail package might be broken. The times are clearly the same, but for some reason your system has picked up that it's CST, not the anonymous zone at offset -0600 that the test expects.

We just switched over to a new time package and zone support is not fully implemented yet (eventually Go will ship with its own zone data files).

Could you please file a bug with as much detail as possible:

Especially include details of your distribution. If you know the location of your time zone data, that would be helpful too.

Andrew

Mark Summerfield

unread,
Dec 2, 2011, 3:03:40 AM12/2/11
to Andrew Gerrand, golang-nuts
On Fri, 2 Dec 2011 09:50:52 +1100
Andrew Gerrand <a...@golang.org> wrote:
> We've just tagged a new Go weekly, weekly.2011-12-02. As usual, you
> can update by running:
> hg pull
> hg update weekly

One major difference I've noticed between weekly.2011-12-0[12] and
earlier releases is that *time.Time values could be serialized using the
json and gob packages (since it had exported fields), but time.Time
values cannot (since they don't).

This changes a two-liner:

encoder := json.NewEncoder(writer)
err := encoder.Encode(data)

(where data is some data structure that contains time.Time values) into:

encoder := json.NewEncoder(writer)
err := encoder.Encode(jsonize(data))

func jsonize(data Data) jsonData {
...
}

And similarly for gob format.

Or am I missing something?

--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Programming in Go" - ISBN 0321774639
http://www.qtrac.eu/gobook.html

Jan Mercl

unread,
Dec 2, 2011, 5:24:48 AM12/2/11
to golan...@googlegroups.com
On Thursday, December 1, 2011 11:50:52 PM UTC+1, Andrew Gerrand wrote:
We've just tagged a new Go weekly, weekly.2011-12-02.

* go/doc: detect headings and format them in html (thanks Volker Dobler).

The detection rules seems to be missing from godoc's godocs (http://code.google.com/p/go/source/browse/src/cmd/godoc/doc.go).

For anyone wanting to use the new feature (or having trouble with the rules getting in way of some existing source comments) here is the description taken from it's CL (http://codereview.appspot.com/5437056/):

----
To structure larger sections of comments in html output headings are detected in comments and formated as h3 in the generated html. A simple heuristic is used to detect headings in comments: A heading is a non-blank, non-indented line preceded by a blank line. It is followed by a blank and a non-blank, non-indented line. A heading must start with an uppercase letter and end with a letter, digit or a colon. A heading may not contain punctuation characters.
----

BTW, does the above mean that headings can't be both numbered and detected like in '3.1 The Foos of the Bars'? And no, I'm really not asking to extend the detection for such case. I'm trying to point out how endless the possibilities for perfectly reasonable headings are. By witch I mean that for the "problem" there is no heuristic being good and simple in the same time.

AllenDang

unread,
Dec 2, 2011, 8:03:06 AM12/2/11
to golang-nuts
I found this error occurred "func can only be compared to nil", does
this means function pointer cannot be compared any more?

roger peppe

unread,
Dec 2, 2011, 8:19:30 AM12/2/11
to AllenDang, golang-nuts
yes. it's a change for Go-1 which means that closures can
be implemented more efficiently.
Reply all
Reply to author
Forward
0 new messages