As usual, you can update by running:
hg pull
hg update weekly
This weekly snapshot renamed the exp/sql package to database/sql, and
moved utf8.String from unicode/utf8 to exp/utf8string.
Package net's SetTimeout methods were changed to SetDeadline.
Many functions in package os now take a os.FileMode argument instead
of a plain uint32. An os.ModeSticky constant is also now defined.
The meaning of the first buffer element for image.YCbCr has changed to
match the semantics of the other image types like image.RGBA.
The NewMD5, NewSHA1 and NewSHA256 functions in crypto/hmac have been
deprecated. Use New instead, explicitly passing the hash function.
Other changes:
* buildscripts: move to buildscript directory (thanks Shenghou Ma).
* bytes: add the usual copyright notice to example_test.go (thanks
Olivier Duperray).
* cmd/go: remove mentions of 'gotest' from the documentation,
skip _obj directories in package scans.
* container/heap: better package documentation.
* crypto/elliptic: add constant-time P224.
* crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512 (thanks Luit van Drongelen),
* crypto/tls: add FreeBSD root certificate location (thanks Shenghou Ma).
* crypto/x509: remove explicit uses of rsa.
* doc: various updates (thanks Jongmin Kim, Scott Lawrence, Shenghou
Ma, Stefan Nilsson).
* encoding/json: allow / and % in tag names,
document angle bracket escaping,
fix comments, tweak tests for tag names (thanks Mikio Hara).
* encoding/xml: marshal/unmarshal xml.Name in field (thanks Gustavo Niemeyer).
* exp/inotify: fix data race in linux tests.
* exp/proxy: fix build after URL changes (thanks Gustavo Niemeyer).
* exp/sql: copy when scanning into []byte by default,
rename NullableString to NullString and allow its use as a parameter.
* exp/ssh: add marshal functions for uint32 and uint64 types,
handle versions with just '\n',
rename (some) fields (thanks Christopher Wedgwood).
* exp/terminal: fix build on non-Linux using Makefiles.
* fmt: enable and fix malloc test,
* gc: don't emit pkgpath for error type,
don't fault on return outside function (thanks Scott Lawrence),
fieldnames in structliterals in exported inlines should not be
qualified if they're embedded builtin types,
fix infinite recursion for embedded interfaces,
give esc.c's sink an orig so -mm diagnostics work again,
handle printing of string/arrayrune conversions.
remove redundant code (thanks Shenghou Ma).
* go/build: no back slash in FindTree returned pkg name (thanks Alex Brainman).
* go/doc: collect imports,
don't shadow receiver.
rewrote and completed test framework.
print only one newline between paragraphs
* go/parser: expressions may have comments.
* go/scanner: fix example (thanks Olivier Duperray).
* go/token: replaced Files() with Iterate().
* godoc: add anchors to cmd documentation headings,
remove "need more packages?" link,
specify HTML page metadata with a JSON blob,
support canonical Paths in HTML metadata.
* html/template: fix docs after API changes (thanks Gustavo Niemeyer).
* html: in foreign content, check for HTML integration points in breakout.
* image/color: rename modelYCbCr to yCbCrModel (thanks Benny Siegert),
simplify documentation (thanks David Crawshaw).
* image: add PixOffset methods.
* math/rand: decrease test duration in short mode,
document default initial seed for global generator (thanks Scott Lawrence).
* mime: make FormatMediaType take full type for consistency.
* misc/cgo/test: make tests run on windows (thanks Alex Brainman).
* net/http/cgi: increase a flaky test timeout.
* net/http: change test to use override param instead of chan,
log handler panic before closing HTTP connection,
send cookies in jar on redirect (thanks Jeff Hodges),
the documentation should call NewRequest with the right signature
(thanks Christoph Hack),
update the Client docs a bit.
* net/url: cleaned up URL interface (v2) (thanks Gustavo Niemeyer).
* net: consistent log format in test (thanks Mikio Hara),
various build fixes (thanks Mikio Hara),
use NewTimer, not NewTicker, in fd_windows.go.
* old/netchan: fix data race on client hashmap.
* os/exec: trivial allocation removal in LookPath (thanks Gustavo Niemeyer).
* os: remove old note about NewSyscallError being special (thanks Alex
Brainman),
* path: added examples (thanks Sanjay Menakuru).
* pkg: Add and fix Copyright of "hand generated" files (thanks Olivier
Duperray),
add missing godoc comments to windows versions (thanks Alex Brainman).
* regexp: add SubexpNames.
* runtime: implement runtime.usleep for FreeBSD/386 and amd64 (thanks
Shenghou Ma),
madvise and SysUnused for Darwin (thanks Dave Cheney).
* sync/atomic: fix data race in tests.
* syscall: add Unix method to TimeSpec, TimeVal,
fix plan9 build (thanks Mikio Hara).
* test: change several tests to not print,
fix bug364 to actually run,
match gccgo error messages for bug345,
split golden.out into expected output per test.
* testing: do not recover example's panic (thanks Shenghou Ma),
document examples.
* text/template/parse: use human error prints.
* text/template: fix nil error on redefinition.
* time: add Since, which returns the time elapsed since some past time t.
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.2012-01-15:weekly.2012-01-20
Fair dinkum.
Nigel.
Hello,
What is the recommended or suggested practice for deadlines when using
vary large granularity operations like io.Copy/ReadFrom/WriteTo ?
I suppose such code is totally not gofix-able.
Regards,
Rémy.
Please note that this is a significant change to the interface of url.URL.
Duplicated fields from URL were dropped so that its behavior
is simple and expected when being stringified and when being
operated by packages like http. Most of the preserved fields
are in unencoded form, except for RawQuery which continues to
exist and be more easily handled via url.Query(). This means
you can now take a url from somewhere, change one of its fields,
and actually expect it to work.
The RawUserinfo field was also replaced since it wasn't practical
to use and had limitations when operating with empty usernames
and passwords which are allowed by the RFC. In its place the
Userinfo type was introduced and made accessible through the
url.User and url.UserPassword functions.
What was previous built as:
url.URL{RawUserinfo: url.EncodeUserinfo("user", ""), ...}
Is now built as:
url.URL{User: url.User("user"), ...}
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I'm not absolutely sure of anything.
> * net/url: cleaned up URL interface (v2) (thanks Gustavo Niemeyer).Please note that this is a significant change to the interface of url.URL.
This is actually one of the most exciting bits in this weekly, IMO.
No it isn't. ;-) I just rolled back a bad push of godoc. The
2012-01-20 docs should be up soon.
Local godoc shouldn't have this issue -please rebuild and try again.
Andrew
No it isn't. ;-) I just rolled back a bad push of godoc. The
2012-01-20 docs should be up soon.Local godoc shouldn't have this issue -please rebuild and try again.
For database/sql I see that there is also a database/sql/driver package,
but it isn't clear to me if any drivers are actually implemented. I
tried this:
package main
import (
"fmt"
"database/sql"
)
func main() {
db, err := sql.Open("sqlite", ":memory:")
fmt.Println(db, err)
}
And got:
<nil> sql: unknown driver "sqlite" (forgotten import?)
I didn't see any packages that looked like they might be drivers.
Thanks!
[snip]
--
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
I guess you have to install the drivers separately from the go
dashboard.
Seems a pity if a SQLite driver isn't included as standard though.
Cheers
Dave
Sent from my iPad
Python ships with SQLite on non-Unix platforms (i.e., on platforms where
it isn't likely to be already installed); Qt ships with it but can be
told to use the system version.
It would be really convenient to have _a_ SQLite driver (and probably
SQLite itself on non-Unix platforms, e.g., Windows), so that people
would have database functionality out of the box. Also, it would provide
a model of how to do it and show where to put it in package hierarchy.
It's just an idea though:-)
Is the weekly documentation up to date?
http://weekly.golang.org/pkg/net/url/ still showing RawUserinfo for example. Gofix isn't correcting issues with that oauth.go code in the Twitterstream project at https://github.com/hoisie/twitterstream/blob/master/oauth.gooauth.go:129: requestTokenUrl.Raw undefined (type *url.URL has no field or method Raw)Let me know if I should be looking elsewhere for updated documentation. Thanks.
It requires updating indeed. Meanwhile, you can use this:
http://weekly.goneat.org/pkg/net/url/
At some point weekly.goneat.org and tip.goneat.org may disappear since
we now have golang.org itself doing that, but that's going to be
announced. For the moment, they continue to work and be updated
automatically without my interaction.
> example. Gofix isn't correcting issues with that oauth.go code in the
> Twitterstream project
Unfortunately these changes are not gofixable right now. We can add a
gofix module in time for the Go 1 release, but even then certain use
cases will require manual reviewing. E.g. accessing/changing the
Raw[A-Z]* fields except for RawQuery has no good replacement, and
hopefully isn't really needed either.
> oauth.go:129: requestTokenUrl.Raw undefined (type *url.URL has no field or method Raw)
For Raw itself there's a reasonable replacement: url.String(), but I
suspect you'll have more trouble than that. The code there is using
container/vector, for instance, which is gone (slices should be used
instead).
I guess "go install" isn't quite ready for prime time yet?