From: Russ Cox
-The
+Before,
+The package adds a new function,
Updating:
-No existing code is affected.
+Running The runtime package
runtime
package in Go 1 includes a new niladic function,
+In Go 1, much of the API exported by package
+runtime
has been removed in favor of
+functionality provided by other packages.
+Code using the runtime.Type
interface
+or its specific concrete type implementations should
+now use package reflect
.
+Code using runtime.Semacquire
or runtime.Semrelease
+should use channels or the abstractions in package sync
.
+The runtime.Alloc
, runtime.Free
,
+and runtime.Lookup
functions, an unsafe API created for
+debugging the memory allocator, have no replacement.
+runtime.MemStats
was a global variable holding
+statistics about memory allocation, and calls to runtime.UpdateMemStats
+ensured that it was up to date.
+In Go 1, runtime.MemStats
is a struct type, and code should use
+runtime.ReadMemStats
+to obtain the current statistics.
+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
.
+The runtime.Cgocalls
and runtime.Goroutines
functions
+have been renamed to runtime.NumCgoCall
and runtime.NumGoroutine
.
go fix
will update code for the function renamings.
+Other code will need to be updated by hand.
The strconv package
@@ -1781,6 +1807,25 @@ The testing/script package has been deleted. It was a dreg.
No code is likely to be affected.
+In Go 1, the functions
+unsafe.Typeof
, unsafe.Reflect
,
+unsafe.Unreflect
, unsafe.New
, and
+unsafe.NewArray
have been removed;
+they duplicated safer functionality provided by
+package reflect
.
+
+Updating:
+Code using these functions must be rewritten to use
+package reflect
.
+The changes to encoding/gob and the protocol buffer library
+may be helpful as examples.
+
diff --git a/doc/go1.tmpl b/doc/go1.tmpl index 314a6de93d..57957beaba 100644 --- a/doc/go1.tmpl +++ b/doc/go1.tmpl @@ -1520,15 +1520,41 @@ signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
-The runtime
package in Go 1 includes a new niladic function,
+In Go 1, much of the API exported by package
+runtime
has been removed in favor of
+functionality provided by other packages.
+Code using the runtime.Type
interface
+or its specific concrete type implementations should
+now use package reflect
.
+Code using runtime.Semacquire
or runtime.Semrelease
+should use channels or the abstractions in package sync
.
+The runtime.Alloc
, runtime.Free
,
+and runtime.Lookup
functions, an unsafe API created for
+debugging the memory allocator, have no replacement.
+
+Before, runtime.MemStats
was a global variable holding
+statistics about memory allocation, and calls to runtime.UpdateMemStats
+ensured that it was up to date.
+In Go 1, runtime.MemStats
is a struct type, and code should use
+runtime.ReadMemStats
+to obtain the current statistics.
+
+The package adds a new 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
.
+The runtime.Cgocalls
and runtime.Goroutines
functions
+have been renamed to runtime.NumCgoCall
and runtime.NumGoroutine
.
Updating:
-No existing code is affected.
+Running go fix
will update code for the function renamings.
+Other code will need to be updated by hand.
+In Go 1, the functions
+unsafe.Typeof
, unsafe.Reflect
,
+unsafe.Unreflect
, unsafe.New
, and
+unsafe.NewArray
have been removed;
+they duplicated safer functionality provided by
+package reflect
.
+
+Updating:
+Code using these functions must be rewritten to use
+package reflect
.
+The changes to encoding/gob and the protocol buffer library
+may be helpful as examples.
+