This week's release introduces a new release tagging scheme. We intend to
continue with our weekly releases, but have renamed the existing tags from
"release" to "weekly". The "release" tag will now be applied to one hand-picked
stable release each month or two.
The revision formerly tagged "release.2011-03-07.1" (now "weekly.2011-03-07.1")
has been nominated our first stable release, and has been given the tag
"release.r56". As we tag each stable release we will post an announcement to
the new golang-announce mailing list:
http://groups.google.com/group/golang-announce
You can continue to keep your Go installation updated using "hg update
release", but now you should only need to update once we tag a new stable
release, which we will announce here. If you wish to stay at the leading edge,
you should switch to the weekly tag with "hg update weekly".
This weekly release includes significant changes to the language spec and the
http, os, and syscall packages. Your code may need to be changed. It also
introduces the new gofix tool.
The closed function has been removed from the language. The syntax for channel
receives has been changed to return an optional second value, a boolean value
indicating whether the channel is closed. This code:
v := <-ch
if closed(ch) {
// channel is closed
}
should now be written as:
v, ok := <-ch
if !ok {
// channel is closed
}
It is now illegal to declare unused labels, just as it is illegal to declare
unused local variables.
The new gofix tool finds Go programs that use old APIs and rewrites them to use
newer ones. After you update to a new Go release, gofix helps make the
necessary changes to your programs. Gofix will handle the http, os, and syscall
package changes described below, and we will update the program to keep up with
future changes to the libraries.
The Hijack and Flush methods have been removed from the http.ResponseWriter
interface and are accessible via the new http.Hijacker and http.Flusher
interfaces. The RemoteAddr and UsingTLS methods have been moved from
http.ResponseWriter to http.Request.
The http.ResponseWriter interface's SetHeader method has been replaced by a
Header() method that returns the response's http.Header. Caller code needs to
change. This code:
rw.SetHeader("Content-Type", "text/plain")
should now be written as:
rw.Header().Set("Content-Type", "text/plain")
The os and syscall packages' StartProcess functions now take their final three
arguments as an *os.ProcAttr and *syscall.ProcAttr values, respectively. This
code:
os.StartProcess(bin, args, env, dir, fds)
should now be written as:
os.StartProcess(bin, args, &os.ProcAttr{Files: fds, Dir: dir, Env: env})
The gob package will now encode and decode values of types that implement the
gob.GobEncoder and gob.GobDecoder interfaces. This allows types with unexported
fields to transmit self-consistent descriptions; one instance is big.Int and
big.Rat.
Other changes:
* 5l, 6l, 8l: reduce binary size about 40% by omitting symbols for
type, string, go.string.
* 5l, 8l: output missing section symbols (thanks Anthony Martin).
* 6l, 8l: fix gdb crash.
* Make.cmd: also clean _test* (thanks Gustavo Niemeyer).
* big: implemented custom Gob(En/De)coder for Int type.
* build: remove duplicate dependency in Make.cmd (thanks Robert Hencke),
run gotest in misc/cgo/test.
* codereview.py: don't suggest change -d if user is not CL author
(thanks Robert Hencke).
* compress/lzw: benchmark a range of input sizes.
* crypto/ecdsa: add package.
* crypto/elliptic: add the N value of each curve.
* crypto/openpgp: bug fixes and fix misnamed function.
* crypto/tls: fix compile error (thanks Dave Cheney).
* doc: Effective Go: some small cleanups,
update FAQ. hello, world is now 1.1MB, down from 1.8MB,
update codelab wiki to fix template.Execute argument order.
* flag: visit the flags in sorted order, for nicer messages.
* fmt: do not export EOF = -1.
* fmt: make ScanState.Token more general (thanks Roger Peppe).
* gc: diagnose unused labels,
fix handling of return values named _,
include all dependencies in export metadata,
make unsafe.Pointer its own kind of type, instead of an
equivalent to *any.
* go/ast, go/parser: populate identifier scopes at parse time.
* go/ast: add FileSet parameter to ast.Print and ast.Fprint.
* go/parser: first constant in a constant declaration must have a value.
* gob: efficiency and reliability fixes.
* gofmt: remove -trace and -ast flags.
* goinstall: handle $(GOOS) and $(GOARCH) in filenames,
handle .c files with gc when cgo isn't used, and
handle .s files with gc (thanks Gustavo Niemeyer).
* gopack: omit time stamps, makes output deterministic.
* gotype: commandline tool to typecheck go programs.
* govet: handle '*' in print format strings.
* hash: new FNV-1a implementation (thanks Pascal S. de Kloe).
* http/cgi: child support (e.g. Go CGI under Apache).
* http: adapt Cookie code to follow IETF draft (thanks Petar Maymounkov),
add test for fixed HTTP/1.0 keep-alive issue,
don't hit external network in client_test.go,
fix transport crash when request URL is nil,
rename interface Transport to RoundTripper,
run tests even with DISABLE_NET_TESTS=1.
* httptest: default the Recorder status code to 200 on a Write.
* io/ioutil: clean-up of ReadAll and ReadFile.
* ioutil: add NopCloser.
* ld: preserve symbol sizes during data layout.
* lib9, libmach: Change GOOS references to GOHOSTOS (thanks Evan Shaw).
* libmach: correct string comparison to revive 6cov on darwin (thanks
Dave Cheney).
* misc/vim: Add indent script for Vim (thanks Ross Light).
* net, os, syslog: fixes for Solaris support.
* net: don't loop to drain wakeup pipe.
* nm: document -S flag.
* openpgp: add PublicKey KeyId string accessors.
* rpc: optimizations, add benchmarks and memory profiling,
use httptest.Server for tests (thanks Robert Hencke).
* runtime: reduce lock contention via wakeup on scheduler unlock,
scheduler, cgo reorganization,
split non-debugging malloc interface out of debug.go into mem.go.
* spec: clarify return statement rules.
* strings: add IndexRune tests, ASCII fast path,
better benchmark names; add BenchmarkIndex.
* syscall: implement Mount and Unmount for linux,
implement Reboot for linux.
* time: fix Time.ZoneOffset documentation (thanks Peter Mundy).
* tls: move PeerCertificates to ConnectionState.
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 release,
after updating, run:
hg log -r weekly.2011-03-07.1:weekly.2011-03-15
Enjoy.
Andrew
it's probably worth noting that this change means that any code
implementing fmt.Scanner will need to be updated.
Sounds like an excellent task for gofix.
When trying to compile release.2011-03-07.1 under Mac OS X 10.6.6
(darwin_amd64) I get the following error (added system info at the
end). I've tried cleaning my pkg folder, but still the same result.
6g -o _gotest_.6 cgi.go cgi_test.go
rm -f _test/http/cgi.a
gopack grc _test/http/cgi.a _gotest_.6
--- FAIL: cgi.TestCGIBasicGet (0.0 seconds)
Unexpected 1 parts from invalid line: ""
--- FAIL: cgi.TestCGIBasicGetAbsPath (0.1 seconds)
Unexpected 1 parts from invalid line: ""
--- FAIL: cgi.TestPathInfo (0.1 seconds)
Unexpected 1 parts from invalid line: ""
--- FAIL: cgi.TestPathInfoDirRoot (0.1 seconds)
Unexpected 1 parts from invalid line: ""
--- FAIL: cgi.TestPathInfoNoRoot (0.1 seconds)
Unexpected 1 parts from invalid line: ""
--- FAIL: cgi.TestCGIBasicPost (0.1 seconds)
Unexpected 1 parts from invalid line: ""
FAIL
make[1]: *** [test] Error 1
make: *** [http/cgi.test] Error 2
tina:src royger$ hg summary
parent: 7666:c5c62aeb6267 release release.r56 weekly.2011-03-07.1
release.2011-03-07.1
branch: default
commit: (clean)
update: 114 new changesets (update)
tina:src royger$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~89/src/configure
--disable-checking --enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin10
--program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10
--target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
Don't know if I missed some steps or special update info, just done hg
pull && hg update release && ./all.bash
Thanks, Roger.
2011/3/16 Martin Capitanio <m...@capitanio.org>:
On Wed, 16 Mar 2011 16:37:44 +1100
Andrew Gerrand <a...@google.com> wrote:
> We've just tagged a new Go release, weekly.2011-03-15. As usual, you
> can update by running:
> hg pull
> hg update release
[snip]
> * misc/vim: Add indent script for Vim (thanks Ross Light).
[snip]
I tried this but still find Alecs King's one much better (esp. when
writing `:=').
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Programming in Python 3" - ISBN 0321680561
http://www.qtrac.eu/py3book.html
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Rapid GUI Programming with Python and Qt" - ISBN 0132354187
http://www.qtrac.eu/pyqtbook.html
Andrew,
On Mar 16, 1:37 am, Andrew Gerrand <a....@google.com> wrote:
> This week's release introduces a new release tagging scheme.
Where is this documented? For example, I don't see it here:
Keeping up with releases
http://golang.org/doc/install.html#releases
Hm, those tests should only run if your Perl environment looks sane. (it does an initial test to feel out the situation, and then proceeds with actually running the tests if the canary one passed...)Not sure why that's not working.What's this say on your machine?$ perl -MCGI -e 1$ perl -v
MacBook-Air-de-Roger-Pau-Monne:~ royger$ perl -MCGI -e 1
MacBook-Air-de-Roger-Pau-Monne:~ royger$ perl -v
This is perl, v5.10.0 built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
MacBook-Air-de-Roger-Pau-Monne:~ royger$
$GOROOT/src/pkg/http/cgi/testdata/test.cgi
Content-Type: text/html
X-Test-Header: X-Test-Value
test=Hello CGI
env-Apple_PubSub_Socket_Render=/tmp/launch-0edkvi/Render
env-COLORFGBG=0;15
env-COMMAND_MODE=legacy
env-DISPLAY=/tmp/launch-ZgIY7i/org.x:0
env-EDITOR=nano
env-GOARCH=amd64
env-GOOS=darwin
env-GOROOT=/Users/royger/go
env-HOME=/Users/royger
env-LANG=es_ES.utf-8
env-LC_COLLATE=es_ES.utf-8
env-LC_CTYPE=es_ES.utf-8
env-LC_MESSAGES=es_ES.utf-8
env-LC_MONETARY=es_ES.utf-8
env-LC_NUMERIC=es_ES.utf-8
env-LC_TIME=es_ES.utf-8
env-LOGNAME=royger
env-PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/Users/royger/go/bin
env-PWD=/Users/royger
env-SHELL=/bin/bash
env-SHLVL=1
env-SSH_AUTH_SOCK=/tmp/launch-qwGsym/Listeners
env-TERM=xterm
env-TERM_PROGRAM=iTerm.app
env-TMPDIR=/var/folders/KJ/KJpKUXKZFcys7Rd+-UDonU+++TI/-Tmp-/
env-USER=royger
env-VERSIONER_PERL_PREFER_32_BIT=no
env-VERSIONER_PERL_VERSION=5.10.0
env-_=/Users/royger/go/src/pkg/http/cgi/testdata/test.cgi
env-__CF_USER_TEXT_ENCODING=0x1F5:0:86
Hope this helps, thanks Roger.
2011/3/16 Johann Höchtl <johann....@gmail.com>:
No, it's only a release by default. The next release will be announced there.
Andrew
> >Where is this documented? For example, I don't see it here:
> >http://golang.org/doc/install.html#releases
>
> I guess even if that get updated, you can't see it there until next stable
> release.
If you are adventurous, you can see documentation updates as they are
It builds perfectly on two linux machines (both running Ubuntu) and
fails on three different machines running OSX (one leopard and two
snow leopard).
The macs fail with the same message as previously mentioned in this
thread. Please let me know if there is anything I can do to help
resolve this issue.
/ Michael
--
Michael Banzon
http://michaelbanzon.com/
Cheers
Dave
It was newline chars in the environment and has been fixed in tip. (Unless there's another problem...)
(phone), brad
If needed I'll supply the full error message, but I'm not sure this
thread is the right one to do it in - it is about the "weekly" :o) The
beginning of the message is:
gopack grc _test/net.a _gotest_.8
panic: test timed out
This is the first time I've tried tip - and I fully understand that
tip might have errors. Normally I use the "release" version, but these
two issues leave me with no working go-compiler on my Mac(s). I hope
that this will be resolved on the next "release" :o)
/ Michael
I was scared for a while :o)
Now I'm no longer running from my good ol' trusted "release" but using
"top" - which also makes me a bit scared :o)
/ Michael