From: Rob Pike
-Also, the
-All these packages are available under the same names, with
-Also, the exp at the time of Go 1's release
utf8.String type has been moved to its own package, exp/utf8string.
+All these packages are available under the same names, with the prefix exp/: exp/ebnf etc.
exp/ prefixed: exp/ebnf etc.
+Also, the utf8.String type has been moved to its own package, exp/utf8string.
gotype command now resides in exp/gotype, while
+Finally, the gotype command now resides in exp/gotype, while
ebnflint is now in exp/ebnflint
+In Go 1, the interface flag.Value has changed slightly.
+The Set method now returns an error instead of
+a bool to indicate success or failure.
+
+There is also a new kind of flag, Duration, to support argument
+values specifying time intervals.
+Values for such flags must be given units, just as time.Duration
+formats them: 10s, 1h30m, etc.
+
var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion")
+
+
+Updating:
+Programs that implement their own flags will need minor manual fixes to update their
+Set methods.
+The Duration flag is new and affects no existing code.
+
@@ -914,7 +940,6 @@ compiler will reject incorrect uses. Templates used in conjuction with any of th to run-time errors.
-
@@ -1064,6 +1089,20 @@ and os.FileMode API.
Code that needs system-specific file details will need to be updated by hand.
+The runtime package in Go 1 includes a new niladic function,
+runtime.NumCPU, that returns the number of CPUs available
+for parallel execution, as reported by the operating system kernel.
+Its value can inform the setting of GOMAXPROCS.
+
+Updating: +No existing code is affected. +
+@@ -1159,6 +1198,35 @@ a cast that must be added by hand; gofix will warn about it.
+
+The testing package has a type, B, passed as an argument to benchmark functions.
+In Go 1, B has new methods, analogous to those of T, enabling
+logging and failure reporting.
+
func BenchmarkSprintf(b *testing.B) {
+ // Verify correctness before running benchmark.
+ b.StopTimer()
+ got := fmt.Sprintf("%x", 23)
+ const expect = "17"
+ if expect != got {
+ b.Fatalf("expected %q; got %q", expect, got)
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ fmt.Sprintf("%x", 23)
+ }
+}
+
+
+Updating:
+Existing code is unaffected, although benchmarks that use println
+or panic should be updated to the new interface.
+
exp at the time of Go 1's release
-Also, the utf8.String type has been moved to its own package, exp/utf8string.
+All these packages are available under the same names, with the prefix exp/: exp/ebnf etc.
-All these packages are available under the same names, with exp/ prefixed: exp/ebnf etc.
+Also, the utf8.String type has been moved to its own package, exp/utf8string.
-Also, the gotype command now resides in exp/gotype, while
+Finally, the gotype command now resides in exp/gotype, while
ebnflint is now in exp/ebnflint
+In Go 1, the interface flag.Value has changed slightly.
+The Set method now returns an error instead of
+a bool to indicate success or failure.
+
+There is also a new kind of flag, Duration, to support argument
+values specifying time intervals.
+Values for such flags must be given units, just as time.Duration
+formats them: 10s, 1h30m, etc.
+
+Updating:
+Programs that implement their own flags will need minor manual fixes to update their
+Set methods.
+The Duration flag is new and affects no existing code.
+
@@ -818,7 +843,6 @@ compiler will reject incorrect uses. Templates used in conjuction with any of th to run-time errors.
-
@@ -968,6 +992,20 @@ and os.FileMode API.
Code that needs system-specific file details will need to be updated by hand.
+The runtime package in Go 1 includes a new niladic function,
+runtime.NumCPU, that returns the number of CPUs available
+for parallel execution, as reported by the operating system kernel.
+Its value can inform the setting of GOMAXPROCS.
+
+Updating: +No existing code is affected. +
+@@ -1063,6 +1101,22 @@ a cast that must be added by hand; gofix will warn about it.
+
+The testing package has a type, B, passed as an argument to benchmark functions.
+In Go 1, B has new methods, analogous to those of T, enabling
+logging and failure reporting.
+
+Updating:
+Existing code is unaffected, although benchmarks that use println
+or panic should be updated to the new interface.
+