-
Notifications
You must be signed in to change notification settings - Fork 0
/
weekly.html
4805 lines (4381 loc) · 225 KB
/
weekly.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- Weekly Snapshot History -->
<p>This page summarizes the changes between tagged weekly snapshots of Go.
For full details, see the <a href="http://code.google.com/p/go/source/list">Mercurial change log</a>.</p>
<p>Weekly snapshots occur often and may not be stable.
If stability of API and code is more important than having the
latest features, use the <a href="release.html">official releases</a> instead.</p>
<p>To update to a specific snapshot, use:</p>
<pre>
hg pull
hg update weekly.<i>YYYY-MM-DD</i>
</pre>
<h2 id="2011-12-06">2011-12-06</h2>
<pre>
This snapshot includes a language change and changes to the strconv and go/doc
packages. The package changes require changes to client code.
The language change is backwards-compatible.
Type elision in arrays, slices, or maps of composite literals has been
extended to include pointers to composite literals. Code like this
var t = []*T{&T{}, &T{}}
may now be written as
var t = []*T{{}, {}}
You can use gofmt -s to simplify such code.
The strconv package has been given a more idiomatic and efficient interface.
Client code can be updated with gofix. See the docs for the details:
http://weekly.golang.org/pkg/strconv/
The go/doc package's ToHTML function now takes a []byte argument instead of a
string.
Other changes:
* crypto/aes: eliminate some bounds checking and truncation (thanks Rémy Oudompheng).
* crypto/x509: if a parent cert has a raw subject, use it.
* encoding/gob: don't send type info for unexported fields.
* exp/ssh: allow for msgUserAuthBanner during authentication (thanks Gustav Paul).
* fmt: benchmark floating point,
only use Stringer or Error for strings.
* gc: changes in export format in preparation of inlining,
disallow map/func equality via interface comparison,
use gofmt spacing when printing map type.
* go/doc: exclude lines ending in ':' from possible headings.
* gobuilder: -commit mode for packages,
cripple -package mode temporarily,
use new dashboard protocol.
* godoc: improved output of examples in html (thanks Volker Dobler).
* gofmt: handle &T in composite literal simplify.
* goinstall: honour -install=false flag when -make=true.
* hash: rewrite comment on Hash.Sum method.
* html: more parser improvements (thanks Andrew Balholm).
* image: avoid func comparison during ColorModel comparison.
* math: add special-cases comments to Sinh and Tanh (thanks Charles L. Dorian).
* misc/dashboard: further implementation work.
* net, syscall: remove BindToDevice from UDPConn, IPConn (thanks Mikio Hara).
* net/mail: correctly compare parsed times in the test.
* os/exec: make LookPath always search CWD under Windows (thanks Benny Siegert).
* runtime: prep for type-specific algorithms.
* strconv: 34% to 63% faster conversions.
</pre>
<h2 id="2011-12-02">2011-12-02</h2>
<pre>
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.Hash's Sum method has been given a []byte argument,
permitting the user to append the hash to an existing byte slice.
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).
</pre>
<h2 id="2011-12-01">2011-12-01</h2>
<pre>
This weekly snapshot includes changes to the time, os, and text/template
packages. The changes to the time and os packages are significant and related.
Code that uses package time, package text/template, or package os's FileInfo
type will require changes.
In package time, there is now one type - time.Time - to represent times.
Note that time.Time should be used as a value, in contrast to old code
which typically used a *time.Time, a pointer to a large struct. (Drop the *.)
Any function that previously accepted a *time.Time, an int64
number of seconds since 1970, or an int64 number of nanoseconds
since 1970 should now accept a time.Time. Especially as a replacement
for the int64s, the type is good documentation about the meaning of
its value.
Whether you were previously calling time.Seconds, time.Nanoseconds,
time.LocalTime, or time.UTC, the replacement is the new function
time.Now.
If you previously wrote code like:
t0 := time.Nanoseconds()
myFunction()
t1 := time.Nanoseconds()
delta := t1 - t0
fmt.Printf("That took %.2f seconds\n", float64(t1-t0)/1e9)
you can now write:
t0 := time.Now()
myFunction()
t1 := time.Now()
delta := t1.Sub(t0)
fmt.Printf("That took %s\n", delta)
In this snippet, the variable delta is of the new type time.Duration, the
replacement for the many int64 parameters that were nanosecond
counts (but not since 1970).
Gofix can do the above conversions and some others, but it does not
rewrite explicit int64 types as time.Time. It is very likely that you will
need to edit your program to change these types after running gofix.
As always, be sure to read the changes that gofix makes using your
version control system's diff feature.
See http://weekly.golang.org/pkg/time/ for details.
In package os, the FileInfo struct is replaced by a FileInfo interface,
admitting implementations by code beyond the operating system.
Code that refers to *os.FileInfo (a pointer to the old struct) should
instead refer to os.FileInfo (the new interface).
The interface has just a few methods:
type FileInfo interface {
Name() string // base name of the file
Size() int64 // length in bytes
Mode() FileMode // file mode bits
ModTime() time.Time // modification time
IsDir() bool // abbreviation for Mode().IsDir()
}
If you need access to the underlying stat_t provided by the operating
system kernel, you can access it by assuming that the FileInfo you are
holding is actually an *os.FileStat, and that it's Sys field is actually a
*syscall.Stat_t, as in:
dev := fi.(*os.FileStat).Sys.(*syscall.Stat_t).Dev
Of course, this is not necessarily portable across different operating
systems.
Gofix will take care of rewriting *os.FileInfo to os.FileInfo for you,
and it will also rewrite expressions like fi.Name into calls like fi.Name().
See http://weekly.golang.org/pkg/os/#FileInfo for details.
The template package has been changed to export a new, simpler API.
The Set type is gone. Instead, templates are automatically associated by
being parsed together; nested definitions implicitly create associations.
Only associated templates can invoke one another.
This approach dramatically reduces the breadth of the construction API.
The html/template package has been updated also.
There's a gofix for the simplest and most common uses of the old API.
Code that doesn't mention the Set type is likely to work after running gofix;
code that uses Set will need to be updated by hand.
The template definition language itself is unchanged.
See http://weekly.golang.org/pkg/text/template/ for details.
Other changes:
* cgo: add support for callbacks from dynamic libraries.
* codereview: gofmt check for non-src/ files (thanks David Crawshaw).
* crypto/openpgp/packet: fix private key checksum.
* crypto/tls: add openbsd root certificate location,
don't rely on map iteration order.
* crypto/x509, crypto/tls: support PKCS#8 private keys.
* dashboard: start of reimplementation in Go for App Engine.
* encoding/xml: fix copy bug.
* exp/gui: move exp/gui and exp/gui/x11 to http://code.google.com/p/x-go-binding
* exp/ssh: various improvements (thanks Dave Cheney and Gustav Paul).
* filepath/path: fix Rel buffer sizing (thanks Gustavo Niemeyer).
* gc: fix Nconv bug (thanks Rémy Oudompheng) and other fixes.
* go/printer, gofmt: performance improvements.
* gofix: test and fix missorted renames.
* goinstall: add -fix flag to run gofix on packages on build failure,
better error reporting,
don't hit network unless a checkout or update is required,
support Google Code sub-repositories.
* html: parser improvements (thanks Andrew Balholm).
* http: fix sniffing bug causing short writes.
* json: speed up encoding, caching reflect calls.
* ld: align ELF data sections.
* math/big: fix destination leak into result value (thanks Roger Peppe),
use recursive subdivision for significant speedup.
* math: faster Cbrt and Sincos (thanks Charles L. Dorian).
* misc/osx: scripts to make OS X package and disk image (thanks Scott Lawrence).
* os: fail if Open("") is called on windows (thanks Alex Brainman).
* runtime: make sure stack is 16-byte aligned on syscall (thanks Alex Brainman).
* spec, gc: allow direct conversion between string and named []byte, []rune.
* sql: add Tx.Stmt to use an existing prepared stmt in a transaction,
more driver docs & tests; no functional changes.
* strings: add ContainsAny and ContainsRune (thanks Scott Lawrence).
* syscall: add SUSv3 RLIMIT/RUSAGE constants (thanks Sébastien Paolacci),
fix openbsd sysctl hostname/domainname workaround,
implement Syscall15 (thanks Alex Brainman).
* time: fix Timer stop.
</pre>
<h2 id="2011-11-18">2011-11-18</h2>
<pre>
This release includes some language changes.
Map and function value comparisons are now disallowed (except for comparison
with nil) as per the Go 1 plan. Function equality was problematic in some
contexts and map equality compares pointers, not the maps' content.
As an experiment, structs are now allowed to be copied even if they contain
unexported fields. This gives packages the ability to return opaque values in
their APIs.
Other changes:
* 6a, 8a: allow $(-1) for consistency with $1, $(1), $-1.
* 6l: code generation fixes (thanks Michał Derkacz).
* build: fix check for selinux allow_execstack on Fedora (thanks Bobby Powers).
* builtin: document delete.
* cgo: don't panic on undeclared enums/structs (thanks Rémy Oudompheng),
fix g0 stack guard.
* crypto/tls: fix handshake message test.
* crypto: update incorrect references to Cipher interface; should be Block.
* doc: clean ups, additions, and fixes to several documents.
* doc/install: add openbsd (thanks Joel Sing!).
* doc: link to Chinese translation of A Tour of Go.
* encoding/json: add marshal/unmarshal benchmark,
decode [] as empty slice, not nil slice,
make BenchmarkSkipValue more consistent.
* env.bash: check for presence of make/gmake (thanks Scott Lawrence).
* exp/sql: NumInput() allow -1 to ignore checking (thanks Yasuhiro Matsumoto),
add DB.Close, fix bugs, remove Execer on Driver (only Conn),
document that for drivers, io.EOF means no more rows,
add client side support for publickey auth (thanks Dave Cheney),
add direct-tcpip client support (thanks Dave Cheney),
change test listen address, also exit test if fails,
other fixes and improvements (thanks Dave Cheney).
* exp/terminal: rename shell to terminal and add SetSize.
* fcgi: fix server capability discovery.
* fmt: distinguish empty vs nil slice/map in %#v.
* gc: better error, type checks, and many fixes,
remove m[k] = x, false syntax (use delete(m, k) instead),
support for building with Plan 9 yacc (thanks Anthony Martin).
* go/printer: make //line formatting idempotent.
* godefs: delete, replaced by cgo -godefs.
* godoc: document -templates flag, fix remote search,
provide mode for flat (non-indented) directory listings.
* gofmt: leave nil nodes of the AST unchanged (thanks Rémy Oudompheng).
* html/template: indirect top-level values before printing.
* html: more parser improvements (thanks Andrew Balholm).
* http: fix serving from CWD with http.ServeFile,
make Dir("") equivalent to Dir(".").
* ld: fix .bss for ldpe (thanks Wei Guangjing).
* math/big: replace nat{} -> nat(nil).
* math: faster Lgamma (thanks Charles L. Dorian).
* mime: implement TypeByExtension for windows.
* misc/bbedit: error and rune support (thanks Anthony Starks).
* misc/benchcmp: benchmark comparison script.
* misc/emacs: add delete builtin (thanks Bobby Powers).
* misc/kate: add error and rune (thanks Evan Shaw).
* misc/notepadplus: error and rune support (thanks Anthony Starks).
* misc/windows: Windows installer in MSI format (thanks Joe Poirier).
* net, io/ioutil: remove use of os.Time (thanks Anthony Martin).
* net/http: fix EOF handling on response body (thanks Gustavo Niemeyer),
fix sniffing when using ReadFrom,
use t.Errorf from alternate goroutine in test.
* os: remove undocumented Envs (use os.Environ instead).
* reflect: empty slice/map is not DeepEqual to nil,
make Value an opaque struct.
* runtime, syscall: convert from godefs to cgo.
* runtime: add nanotime for Plan 9 (thanks Anthony Martin),
add timer support, use for package time,
avoid allocation for make([]T, 0).
* strconv: add Ftoa benchmarks, make Ftoa faster.
* syscall: delete syscall.Sleep, take over env implementation, use error.
* testing: add file:line stamps to messages, print results to standard output.
* text/template: refactor set parsing.
* time: add ISOWeek method to Time (thanks Volker Dobler).
* various: avoid func compare, reduce overuse of os.EINVAL + others.
</pre>
<h2 id="2011-11-09">2011-11-09</h2>
<pre>
This weekly snapshot renames various Go packages as described in the Go 1 plan.
Import statements in client code can be updated automatically with gofix.
The changes are:
asn1 -> encoding/asn1
big -> math/big
cmath -> math/cmplx
csv -> encoding/csv
exec -> os/exec
exp/template/html -> html/template
gob -> encoding/gob
http -> net/http
http/cgi -> net/http/cgi
http/fcgi -> net/http/fcgi
http/httptest -> net/http/httptest
http/pprof -> net/http/pprof
json -> encoding/json
mail -> net/mail
rpc -> net/rpc
rpc/jsonrpc -> net/rpc/jsonrpc
scanner -> text/scanner
smtp -> net/smtp
syslog -> log/syslog
tabwriter -> text/tabwriter
template -> text/template
template/parse -> text/template/parse
rand -> math/rand
url -> net/url
utf16 -> unicode/utf16
utf8 -> unicode/utf8
xml -> encoding/xml
</pre>
<h2 id="2011-11-08">2011-11-08</h2>
<pre>
This weekly snapshot includes some package changes.
In preparation for the Go 1 package reorganziation the sources for various
packages have been moved, but the import paths remain unchanged. This
inconsistency breaks goinstall at this snapshot. If you use goinstall, please
stay synced to the previous weekly snapshot until the next one is tagged.
The Error methods in the html, bzip2, and sql packages that return error values
have been renamed to Err.
Some non-core parts of the http package have been moved to net/http/httputil.
The Dump* and NewChunked* functions and ClientConn, ServerConn, and
ReverseProxy types have been moved from http to httputil.
The API for html/template is now a direct copy of the template API, instead of
exposing a single Escape function. For HTML templates, simply use the
html/template package as you would the template package.
Other changes:
* all: rename os.EOF to io.EOF in non-code contexts (thanks Vincent Vanackere),
sort imports with gofix.
* archive/zip: close file opened with OpenReader (thanks Dmitry Chestnykh).
* bufio: return nil line from ReadLine on error, as documented.
* builtin: document basic types and the built-in error type.
* bytes: add Contains function.
* exp/sql: finish implementation of transactions, flesh out types, docs.
* exp/ssh: improved client authentication support (thanks Dave Cheney).
* gc: better error message for range over non-receive channel,
bug fixes and clean-ups,
detect type switch variable not used cases,
fix escaping of package paths in symbol names,
helpful error message on method call on pointer to pointer,
portably read archive headers (thanks Ron Minnich).
* gob: fix bug when registering the same type multiple times.
* gofix: avoid panic on body-less functions in netudpgroup,
make fix order implicit by date.
* gofmt, gofix: sort imports.
* goinstall: support launchpad.net/~user branches (thanks Jani Monoses).
* gopack: do not look for Go metadata in non-Go objects.
* gotest: don't run examples that have no expected output.
* html: the parser bug fixing campaign continues (thanks Andrew Balholm).
* http: fix whitespace handling in sniffer,
only recognize application/x-www-form-urlencoded in ParseForm,
support Trailers in ReadRequest.
* lib9: add ctime.
* math: faster Gamma (thanks Charles L. Dorian),
improved accuracy for Tan (thanks Charles L. Dorian),
improved high-angle test for Cos, Sin and Tan (thanks Charles L. Dorian).
* net: implement LookupTXT for windows (thanks Alex Brainman).
* os,text,unicode: renamings.
* runtime/cgo: fix data declaration to be extern.
* runtime: add timespec definition for freebsd,
add windows callback tests (thanks Alex Brainman),
fix prototype for openbsd thrsleep,
fix set and not used,
unify mutex code across OSes,
windows_386 sighandler to use correct g (thanks Alex Brainman).
* template: format error with pointer receiver,
make redefinition of a template in a set more consistent.
* test: clear execute bit from source file (thanks Mikio Hara),
make closedchan.go exit with failure if something fails.
* time: faster Nanoseconds call.
* websocket: return an error HTTP response for bad websocket request.
* xml: allow parsing of <_> </_>. (thanks David Crawshaw).
</pre>
<h2 id="2011-11-02">2011-11-02 (new error type)</h2>
<pre>
This snapshot introduces the built-in error type, defined as
type error interface {
Error() string
}
The error type replaces os.Error. Notice that the method name has changed from
String to Error. Package fmt's Print formats both Stringers and errors:
in general there is no need to implement both String and Error methods.
Gofix can update most code. If you have split your package across many files,
it may help to use the -force=error command-line option, which forces gofix to
apply the error fix even if it is not obvious that a particular file needs it.
As always, it is a good idea to read and test the changes that gofix made
before committing them to your version control system.
</pre>
<h2 id="2011-11-01">2011-11-01</h2>
<pre>
* 6l: remove mention of -e flag - it does nothing.
* cc: change cas to newcase (thanks Ron Minnich).
* crypto/openpgp/error: use Error in names of error impl types.
* crypto/rsa: change public exponent from 3 to 65537.
* crypto/tls: add Error method to alert.
* doc: add link to A Tour of Go in Japanese,
add 'all' make rule to build all docs,
refer to tour.golang.org instead of go-tour.appspot.com.
* exp/norm: fixed bug that crept in with moving to the new regexp.
* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).
* fmt: handle os.Error values explicity (as distinct from Stringer).
* gc: clean up printing,
fix [568]g -V crash (thanks Mikio Hara),
test + fix escape analysis bug.
* go/build: avoid os.Error in tests.
* go/doc: remove os.NewError anti-heuristic.
* go/parser: test and fix := scoping bug.
* gob: split uses of gobError, remove unnecessary embedding.
* gofix: test import insertion, deletion.
* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).
* gopack: change archive file name length back to 16.
* html: fix print argument in test,
more parser improvements (thanks Andrew Balholm).
* json: properly handle nil slices (thanks Alexander Reece).
* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).
* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).
* misc/vim: add rune keyword (thanks Jongmin Kim).
* misc/windows: can be used for amd64 (thanks Alex Brainman).
* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).
* os: do not interpret 0-length read as EOF.
* pkg: remove .String() from some print arguments.
* rpc: avoid infinite loop on input error.
* runtime/pprof: document OS X being broken.
* runtime: lock the main goroutine to the main OS thread during init.
* spec: define that initialization is sequential.
* strconv: use better errors than os.EINVAL, os.ERANGE.
* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).
* template: do not use error as stringer,
fix error checking on execute without parse (thanks Scott Lawrence).
* test/alias.go: additional tests.
* test: error-related fixes.
* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.
* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).
</pre>
<h2 id="2011-10-26">2011-10-26 (new rune type)</h2>
<pre>
This snapshot introduces the rune type, an alias for int that
should be used for Unicode code points.
A future release of Go (after Go 1) will change rune to be an
alias for int32 instead of int. Using rune consistently is the way
to make your code build both before and after this change.
To test your code for rune safety, you can rebuild the Go tree with
GOEXPERIMENT=rune32 ./all.bash
which builds a compiler in which rune is an alias for int32 instead of int.
Also, run govet on your code to identify methods that might need to have their
signatures updated.
</pre>
<h2 id="2011-10-25">2011-10-25</h2>
<pre>
* big: make SetString return nil if an error occurs,
new Rat.Inv method,
usable zero Rat values without need for explicit initialization.
* codereview: show LGTMs in hg p.
* crypto/x509: fix names in certificate generation.
* exp/ssh: add experimental ssh client,
introduce Session to replace Cmd for interactive commands,
server cleanups (thanks Dave Cheney).
* exp/types: fix crash in parseBasicType on unknown type.
* fmt: don't panic formatting nil interfaces (thanks Gustavo Niemeyer).
* go/ast, go/token: actually run tests; fix go/ast test.
* gotest: explicit -help flag, use $GCFLAGS like make does.
* govet: check canonical dynamic method signatures.
* html: improved parsing (thanks Andrew Balholm),
parse <select> tags, parse and render comment nodes,
remove the Tokenizer.ReturnComments option.
* http: Transport: with TLS InsecureSkipVerify, skip hostname check.
* misc/vim: add highlighting for delete (thanks Dave Cheney).
* net: do not set SO_REUSEADDR for windows (thanks Alex Brainman).
* os/inotify: move to exp/inotify (thanks Mikio Hara).
* runtime: include bootstrap m in mcpu accounting (thanks Hector Chu).
* syscall: use uintptr for Mount flags.
</pre>
<h2 id="2011-10-18">2011-10-18</h2>
<pre>
This weekly snapshot includes some language and package changes that may
require code changes. Please read these notes carefully, as there are many
changes and your code will likely be affected.
The syntax for map deletion has been changed. Code that looks like:
m[x] = 0, false
should be written as:
delete(m, x)
The compiler still accepts m[x] = 0, false for now; even so, you can use gofix
to rewrite such assignments into delete(m, x).
The Go compiler will reject a return statement without arguments when any of
the result variables has been shadowed. Code rejected as a result of this
change is likely to be buggy.
Receive-only channels (<-chan T) cannot be closed.
The compiler will diagnose such attempts.
The first element of a map iteration is chosen at random. Code that depends on
iteration order will need to be updated.
Goroutines may be run during program initialization.
A string may be appended to a byte slice. This code is now legal:
var b []byte
var s string
b = append(b, s...)
The gotry command and its associated try package have been deleted.
It was a fun experiment that - in the end - didn't carry its weight.
The gotype tool has been moved to exp/gotype and its associated go/types
package has been moved to exp/types. The deprecated go/typechecker package has
been deleted.
The enbflint tool has been moved to pkg/exp/ebnflint and its associated ebnf
package has been moved to pkg/exp/ebnf.
The netchan package has been moved to old/netchan.
The http/spdy package has been moved to exp/spdy.
The exp/datafmt package has been deleted.
The container/vector package has been deleted. Slices are better:
http://code.google.com/p/go-wiki/wiki/SliceTricks
Other changes:
* 5l/6l/8l: correct ELFRESERVE diagnostic (thanks Anthony Martin).
* 6l/8l: support OS X code signing (thanks Mikkel Krautz).
* asn1: accept UTF8 strings as ASN.1 ANY values.
* big: handle aliasing correctly for Rat.SetFrac.
* build: add missing nuke target (thanks Anthony Martin),
catch future accidental dependencies to exp or old packages,
more robustly detect gold 2.20 (thanks Christopher Wedgwood),
pass $GCFLAGS to compiler,
stop on failed deps.bash.
* crypto/tls: add 3DES ciphersuites,
add server side SNI support,
fetch root CA from Windows store (thanks Mikkel Krautz),
fetch root certificates using Mac OS API (thanks Mikkel Krautz),
fix broken looping code in windows root CA fetcher (thanks Mikkel Krautz),
more Unix root certificate locations.
* crypto/x509: add code for dealing with PKIX public keys,
keep the raw Subject and Issuer.
* csv: fix overly aggressive TrimLeadingSpace.
* exp/ssh: general cleanups for client support (thanks Dave Cheney).
* exp/template/html: fix bug in cssEscaper.
* exp/terminal: split terminal handling from exp/ssh.
* exp/winfsnotify: filesystem watcher for Windows (thanks Hector Chu).
* fmt: fix test relying on map iteration order.
* gc: changes to export format in preparation for inlining,
pass FlagNoPointers to runtime.new,
preserve uint8 and byte distinction in errors and import data,
stricter multiple assignment + test,
treat uintptr as potentially containing a pointer.
* go/scanner: remove AllowIllegalChars mode.
* go/token: document deserialization property.
* gob: avoid one copy for every message written.
* godefs: add enum/const testdata (thanks Dave Cheney).
* godoc: generate package toc in template, not in JavaScript,
show "unexported" declarations when executing "godoc builtin",
show correct source name with -path.
* gofix: make fix order explicit, add mapdelete.
* gofmt: fix //line handling,
disallow rewrites for incomplete programs.
* gotest: avoid conflicts with the name of the tested package (thanks Esko Luontola),
test example code.
* goyacc: clean up after units (thanks Anthony Martin),
make more gofmt-compliant.
* html: add a Render function, various bug fixes and improvements,
parser improvements (thanks Andrew Balholm).
* http: DoS protection: cap non-Handler Request.Body reads,
RoundTrippers shouldn't mutate Request,
avoid panic caused by nil URL (thanks Anthony Martin),
fix read timeouts and closing,
remove Request.RawURL.
* image/tiff: implement PackBits decoding (thanks Benny Siegert).
* ld: fix "cannot create 8.out.exe" (thanks Jaroslavas Počepko).
* misc/emacs: add a "godoc" command, like M-x man (thanks Evan Martin).
* misc/swig: delete binaries (thanks Anthony Martin).
* misc/windows: automated toolchain packager (thanks Joe Poirier).
* net/windows: implement ip protocol name to number resolver (thanks Alex Brainman).
* net: add File method to IPConn (thanks Mikio Hara),
allow LookupSRV on non-standard DNS names,
fix "unexpected socket family" error from WriteToUDP (thanks Albert Strasheim),
fix socket leak in case of Dial failure (thanks Chris Farmiloe),
remove duplicate error information in Dial (thanks Andrey Mirtchovski),
return error from CloseRead and CloseWrite (thanks Albert Strasheim),
skip ICMP test on Windows too unless uid 0.
* reflect: disallow Interface method on Value obtained via unexported name,
make unsafe use of SliceHeader gc-friendly.
* rpc: don't panic on write error.
* runtime: faster strings,
fix crash if user sets MemProfileRate=0,
fix crash when returning from syscall during gc (thanks Hector Chu),
fix memory leak in parallel garbage collector.
* scanner: invalidate scanner.Position when no token is present.
* spec: define order of multiple assignment.
* syscall/windows: dll function load and calling changes (thanks Alex Brainman).
* syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go (thanks Dave Cheney),
adjust Mount to accomodate stricter FS implementations.
* testing: fix time reported for failing tests.
* utf8: add Valid and ValidString.
* websocket: tweak hybi ReadHandshake to support Firefox (thanks Luca Greco).
* xml: match Marshal's XMLName behavior in Unmarshal (thanks Chris Farmiloe).
</pre>
<h2 id="2011-10-06">2011-10-06</h2>
<pre>
This weekly snapshot includes changes to the io, image, and math packages that
may require changes to client code.
The io package's Copyn function has been renamed to CopyN.
The math package's Fabs, Fdim, Fmax, Fmin and Fmod functions
have been renamed to Abs, Dim, Max, Min, and Mod.
Parts of the image package have been moved to the new image/color package.
The spin-off renames some types. The new names are simply better:
image.Color -> color.Color
image.ColorModel -> color.Model
image.ColorModelFunc -> color.ModelFunc
image.PalettedColorModel -> color.Palette
image.RGBAColor -> color.RGBA
image.RGBAColorModel -> color.RGBAModel
image.RGBA64Color -> color.RGBA64
image.RGBA64ColorModel -> color.RGBA64Model
(similarly for NRGBAColor, GrayColorModel, etc)
The image.ColorImage type stays in the image package, but is renamed:
image.ColorImage -> image.Uniform
The image.Image implementations (image.RGBA, image.RGBA64, image.NRGBA,
image.Alpha, etc) do not change their name, and gain a nice symmetry:
an image.RGBA is an image of color.RGBA, etc.
The image.Black, image.Opaque uniform images remain unchanged (although their
type is renamed from image.ColorImage to image.Uniform).
The corresponding color types (color.Black, color.Opaque, etc) are new.
Nothing in the image/ycbcr is renamed yet. The ycbcr.YCbCrColor and
ycbcr.YCbCrImage types will eventually migrate to color.YCbCr and image.YCbCr,
at a later date.
* 5g/6g/8g: fix loop finding bug, fix -f(), registerize variables again.
* 5l/6l/8l: add a DT_DEBUG dynamic tag to a dynamic ELF binary.
* archive/zip: read and write unix file modes (thanks Gustavo Niemeyer).
* build: clear execute bit from source files (thanks Mikio Hara).
* bytes: add EqualFold.
* cgo: allow Windows path characters in flag directives (thanks Joe Poirier),
support for mingw-w64 4.5.1 and newer (thanks Wei Guangjing).
* codereview: extra repo sanity check,
fix for Mercurial 1.9.2,
fix hg change in Windows console (thanks Yasuhiro Matsumoto).
* crypto/elliptic: use %x consistently in error print.
* doc/spec: remove notes about gccgo limitations, now fixed.
* doc: add 'Debugging Go code with GDB' tutorial,
fix memory model read visibility bug.
* encoding/binary: PutX functions require buffer of sufficient size,
added benchmarks, support for varint encoding.
* exec: add Command.ExtraFiles.
* exp/sql{,/driver}: new database packages.
* exp/ssh: move common code to common.go (thanks Dave Cheney).
* exp/template/html: work continues.
* fmt: replace channel cache with slice.
* gc: limit helper threads based on ncpu.
* go/doc, godoc, gotest: support for reading example documentation.
* go: documentation and skeleton implementation of new command.
* gob: protect against invalid message length,
allow sequential decoders on the same input stream.
* hgpatch: do not use hg exit status (thanks Yasuhiro Matsumoto).
* http: add Location method to Response,
don't send a 400 Bad Request after a client shutdown.
* index/suffixarray: 4.5x faster index serialization (to memory).
* io/ioutil: add a comment on why devNull is a ReaderFrom.
* json: use strings.EqualFold instead of strings.ToLower.
* misc/emacs: fix indent bug.
* net: add shutdown: TCPConn.CloseWrite and CloseRead.
* net: use AF_UNSPEC instead of individual address family (thanks Mikio Hara).
* path/filepath: added Rel as the complement of Abs (thanks Gustavo Niemeyer).
* pkg/syscall: add Mkfifo for linux platforms.
* regexp: move to old/regexp, replace with exp/regexp, speedups.
* runtime/gdb: fix pretty printing of channels,
gracefully handle not being able to find types.
* runtime: check for nil value pointer in select syncsend case,
faster finalizers,
fix malloc sampling bug,
fix map memory leak,
fix spurious deadlock reporting,
fix usleep on linux/386 and re-enable parallel gc (thanks Hector Chu),
parallelize garbage collector mark + sweep.
* strconv: faster Unquote in common case.
* strings: add EqualFold, Replacer, NewReplacer.
* suffixarray: add benchmarks for construction (thanks Eric Eisner).
* syscall: add GetsockoptByte, SetsockoptByte for openbsd (thanks Mikio Hara),
add IPv4 ancillary data for linux (thanks Mikio Hara),
mark stdin, stdout, stderr non-inheritable by child processes (thanks Alex Brainman),
mksyscall_windows.pl creates non-syscall packages (thanks Jaroslavas Počepko),
update multicast socket options (thanks Mikio Hara).
* testing: support for running tests in parallel (thanks Miki Tebeka).
* time: make month/day name comparisons case insenstive.
* unicode: fix make tables.
* vim: Send GoFmt errors to a location list (thanks Paul Sbarra).
* websocket: add hybi-13 support, add mutex to make websocket full-duplex.
</pre>
<h2 id="2011-09-21">2011-09-21</h2>
<pre>
This weekly contains several improvements, bug fixes, and new packages.
* archive/tar: document Header fields and Type flags (thanks Mike Rosset).
* bytes: fix Replace so it actually copies (thanks Gustavo Niemeyer).
* cgo: use GOARCH from the environment (thanks Jaroslavas Počepko).
* codereview: save CL messages in $(hg root)/last-change.
* crypto/bcrypt: new package (thanks Jeff Hodges).
* crypto/blowfish: exposing the blowfish key schedule (thanks Jeff Hodges).
* doc: link to golang-france.
* doc: when configuring gold for gccgo, use --enable-gold=default.
* exp/norm: changed trie to produce smaller tables.
* exp/ssh: new package,
refactor halfConnection to transport (thanks Dave Cheney).
* exp/template/html: more fixes and improvements.
* filepath: fix Glob to return no error on nonmatching patterns.
* gc: disallow invalid map keys,
handle complex CONVNOP.
* gob: allocation fixes.
* godoc: simplify internal FileSystem interface.
* http/cgi: clean up environment (thanks Yasuhiro Matsumoto).
* http: always include Content-Length header, even for 0 (thanks Dave Grijalva),
check explicit wrong Request.ContentLength values,
fix TLS handshake blocking server accept loop,
prevent DumpRequest from adding implicit headers.
* httptest: add NewUnstartedServer.
* json: clearer Unmarshal doc,
skip nil in UnmarshalJSON and (for symmetry) MarshalJSON.
* net: use /etc/hosts first when looking up IP addresses (thanks Andrey Mirtchovski).
* reflect: add comment about the doubled semantics of Value.String.
* runtime: implement pprof support for windows (thanks Hector Chu),
increase stack system space on windows/amd64 (thanks Hector Chu).
* suffixarray: generate less garbage during construction (thanks Eric Eisner),
improved serialization code using gob instead of encoding/binary.
* sync/atomic: replace MFENCE with LOCK XADD.
</pre>
<h2 id="2011-09-16">2011-09-16</h2>
<pre>
This weekly snapshot includes changes to the image, path/filepath, and time
packages. Code that uses these packages may need to be updated.
The image package's NewX functions (NewRGBA, NewNRGBA, etc) have been changed
to take a Rectangle argument instead of a width and height.
Gofix can make these changes automatically.
The path/filepath package's Walk function has been changed to take a WalkFunc
function value instead of a Visitor interface value. WalkFunc is like the
Visitor's VisitDir and VisitFile methods except it handles both files and
directories:
func(path string, info *os.FileInfo, err os.Error) os.Error
To skip walking a directory (like returning false from VisitDir) the WalkFunc
must return SkipDir.
The time package's Time struct's Weekday field has been changed to a method.
The value is calculated on demand, avoiding the need to re-parse
programmatically-constructed Time values to find the correct weekday.
There are no gofixes for the filepath or time API changes, but instances of the
old APIs will be caught by the compiler. The Weekday one is easy to update by
hand. The Walk one may take more consideration, but will have fewer instances
to fix.
* build: add build comments to core packages.
* codereview: Mercurial 1.9 fix for hg diff @nnn.
* crypto/tls: handle non-TLS more robustly,
support SSLv3.
* debug/elf: permit another case of SHT_NOBITS section overlap in test.
* exm/template/html: more work on this auto-escaping HTML template package.
* exp/norm: added regression test tool for the standard Unicode test set.
* exp/regexp/syntax: fix invalid input parser crash,
import all RE2 parse tests + fix bugs.
* exp/regexp: add MustCompilePOSIX, CompilePOSIX, leftmost-longest matching.
* flag: make zero FlagSet useful.
* gc: clean up if grammar.
* go/build: handle cgo, // +build comments.
* go/printer: use panic/defer instead of goroutine for handling errors.
* go/token: support to serialize file sets.
* godoc, suffixarray: switch to exp/regexp.
* godoc: show packages matching a query at the top,
support for complete index serialization,
use go/build to find files in a package.
* gofmt: accept program fragments on standard input, add else test.
* http/cgi: add openbsd environment configuration.
* http: document that Response.Body is non-nil.
* image/png: don't use a goroutine to decode, to permit decode during init.
* json: if a field's tag is "-", ignore the field for encoding and decoding.
* ld: grow dwarf includestack on demand.
* net, syscall: implement SetsockoptIPMReq(), and
move to winsock v2.2 for multicast support (thanks Paul Lalonde).
* net: add a LookupTXT function.
* os: os.RemoveAll to check for wboth error codes on Windows (thanks Jaroslavas Počepko).
* path/filepath: fix Visitor doc (thanks Gustavo Niemeyer),
make UNC file names work (thanks Yasuhiro Matsumoto).
* runtime: optimizations to channels on Windows (thanks Hector Chu),
syscall to return both AX and DX for windows/386 (thanks Alex Brainman).
* sync/atomic: add 64-bit Load and Store.
* syscall: add route flags for linux (thanks Mikio Hara).
* test: add test for inheriting private method from anonymous field.
* websocket: fix infinite recursion in Addr.String() (thanks Tarmigan Casebolt),
rename websocket.WebSocketAddr to *websocket.Addr.
</pre>
<h2 id="2011-09-07">2011-09-07</h2>
<pre>
This weekly snapshot consists of improvements and bug fixes, including fixes
for issues introduced by escape analysis changes in the gc compiler.
* build: clear execute bit from Go files (thanks Mike Rosset),
error out if problem with sudo.bash /usr/local/bin (thanks Mike Rosset).
* exp/norm: add Reader and Writer,
performance improvements of quickSpan.
* exp/regexp: bug fixes and RE2 tests.
* exp/template/html: string replacement refactoring,
tweaks to js{,_test}.go.
* gc: add -p flag to catch import cycles earlier,
fix label recursion bugs,
fix zero-length struct eval,
zero stack-allocated slice backing arrays,
* gc, ld: fix Windows file paths (thanks Hector Chu).
* go/parser: accept corner cases of signature syntax.
* gobuilder: ignore _test.go files when looking for docs, more logging.
* godoc: minor tweaks for App Engine use.
* gofix: do not convert url in field names (thanks Gustavo Niemeyer).
* gofmt: indent multi-line signatures.
* gopprof: regexp fixes (thanks Hector Chu).
* image/png: check zlib checksum during Decode.
* libmach: fix incorrect use of memset (thanks Dave Cheney).
* misc/goplay: fix template output.
* net: ParseCIDR returns IPNet instead of IPMask (thanks Mikio Hara),
sync CIDRMask code, doc.
* os: use GetFileAttributesEx to implement Stat on windows (thanks Alex Brainman).
* runtime: fix openbsd 386 raisesigpipe,
implement exception handling on windows/amd64 (thanks Hector Chu),
test for concurrent channel consumers (thanks Christopher Wedgwood).
* sort: use heapsort to bail out quicksort (thanks Ziad Hatahet).
* sync/atomic: add LoadUintptr, add Store functions.
* syscall: update routing message attributes handling (thanks Mikio Hara).
* template: fix deadlock,
indirect or dereference function arguments if necessary,
slightly simplify the test for assignability of arguments.
* url: handle ; in ParseQuery.
* websocket: fix incorrect prints found by govet (thanks Robert Hencke).
</pre>
<h2 id="2011-09-01">2011-09-01</h2>
<pre>
This weekly contains performance improvements and bug fixes.
The gc compiler now does escape analysis, which improves program performance
by placing variables on the call stack instead of the heap when it is safe to
do so.
The container/vector package is deprecated and will be removed at some point
in the future.
Other changes:
* archive/tar: support symlinks. (thanks Mike Rosset)
* big: fix nat.scan bug. (thanks Evan Shaw)
* bufio: handle a "\r\n" that straddles the buffer.
add openbsd.
avoid redundant bss declarations.
fix unused parameters.
fix windows/amd64 build with newest mingw-w64. (thanks Hector Chu)
* bytes: clarify that NewBuffer is not for beginners.
* cgo: explain how to free something.
fix GoBytes. (thanks Gustavo Niemeyer)
fixes callback for windows amd64. (thanks Wei Guangjing)
note that CString result must be freed. (thanks Gustavo Niemeyer)
* cov: remove tautological #defines. (thanks Lucio De Re)
* dashboard: yet another utf-8 fix.
* doc/codelab/wiki: fix Makefile.
* doc/progs: fix windows/amd64. (thanks Jaroslavas Počepko)
* doc/tmpltohtml: update to new template package.
* doc: emphasize that environment variables are optional.
* effective_go: convert to use tmpltohtml.
* exp/norm: reduced the size of the byte buffer used by reorderBuffer by half by reusing space when combining.
a few minor fixes to support the implementation of norm.
added implementation for []byte versions of methods.
* exp/template/html: add some tests for ">" attributes.
added handling for URL attributes.
differentiate URL-valued attributes (such as href).
reworked escapeText to recognize attr boundaries.
* exp/wingui: made compatible with windows/amd64. (thanks Jaroslavas Počepko)
* flag: add Parsed, restore Usage.
* gc: add openbsd.
escape analysis.
fix build on Plan 9. (thanks Lucio De Re)
fix div bug.
fix pc/line table. (thanks Julian Phillips)
fix some spurious leaks.
make static initialization more static.
remove JCXZ; add JCXZW, JCXZL, and JCXZQ instructions. (thanks Jaroslavas Počepko)
shuffle #includes.
simplify escape analysis recursion.
tweak and enable escape analysis.
* go/ast cleanup: base File/PackageExports on FilterFile/FilterPackage code.
adjustments to filter function.
fix ast.MergePackageFiles to collect infos about imports. (thanks Sebastien Binet)
generalize ast.FilterFile.
* go/build: add test support & use in gotest.
separate test imports out when scanning. (thanks Gustavo Niemeyer)
* go/parser: fix type switch scoping.
fix type switch scoping.
* gob: explain that Debug isn't useful unless it's compiled in.
* gobuilder: increase log limit.
* godashboard: fix utf-8 in user names.
* godoc: first step towards reducing index size.
add dummy playground.js to silence godoc warning at start-up.
added systematic throttling to indexing goroutine.
fix bug in zip.go.
support for reading/writing (splitted) index files.
use virtual file system when generating package synopses.
* gofix: forgot to rename the URL type.
osopen: fixed=true when changing O_CREAT. (thanks Tarmigan Casebolt)
* goinstall: error out with paths that end with '/'. (thanks Tarmigan Casebolt)
report lack of $GOPATH on errors. (thanks Gustavo Niemeyer)
select the tag that is closest to runtime.Version.
* gotry: add missing $. (thanks Tarmigan Casebolt)
* http: add MaxBytesReader to limit request body size.
add file protocol transport.
adjust test threshold for larger suse buffers.
delete error kludge.
on invalid request, send 400 response.
return 413 instead of 400 when the request body is too large. (thanks Dave Cheney)
support setting Transport's TLS client config.
* image/tiff: add a decode benchmark. (thanks Benny Siegert)
decoder optimization. (thanks Benny Siegert)
* image: add PalettedImage interface, and make image/png recognize it. (thanks Jaroslavas Počepko)
* io: add TeeReader. (thanks Hector Chu)
* json: add struct tag option to wrap literals in strings.
calculate Offset for Indent correctly. (thanks Jeff Hodges)
fix decode bug with struct tag names with ,opts being ignored.
* ld: handle Plan 9 ar format. (thanks Lucio De Re)
remove duplicate bss definitions.
* libmach: support reading symbols from Windows .exe for nm. (thanks Mateusz Czapliński)
* math: fix Pow10 loop. (thanks Volker Dobler)
* mime: ParseMediaType returns os.Error now, not a nil map.
media type formatter. (thanks Pascal S. de Kloe)
text charset defaults. (thanks Pascal S. de Kloe)
* misc/dashboard: remove limit for json package list.
* misc/emacs: refine label detection.
* net: add ParseMAC function. (thanks Paul Borman)
change the internal form of IPMask for IPv4. (thanks Mikio Hara)
disable "tcp" test on openbsd.
fix windows build. (thanks Alex Brainman)
join and leave a IPv6 group address, on a specific interface. (thanks Mikio Hara)
make use of IPv4len, IPv6len. (thanks Mikio Hara)
move internal string manipulation routines to parse.go. (thanks Mikio Hara)
* os: disable Hostname test on OpenBSD.