From: Robert Griesemer Date: Wed, 18 Jan 2012 22:35:23 +0000 (-0800) Subject: doc/go1.*: documented changes to go/* package tree X-Git-Tag: weekly.2012-01-20~50 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0203fbee6439b12c48096482638fecfde7573a52;p=gostls13.git doc/go1.*: documented changes to go/* package tree R=r CC=golang-dev https://golang.org/cl/5557053 --- diff --git a/doc/go1.html b/doc/go1.html index a20bd13115..2018b1aca2 100644 --- a/doc/go1.html +++ b/doc/go1.html @@ -918,6 +918,70 @@ and os.FileMode API. Code that needs system-specific file details will need to be updated by hand.

+

The package tree go

+ +

+Several packages under go have slightly revised APIs. +

+ +

+The modes AllowIllegalChars and InsertSemis have been removed +from the go/scanner package. They were mostly +useful for scanning text other then Go source files. Instead, the +text/scanner package should be used +for that purpose. +

+ +

+The set of parse functions provided by the go/parser +package has been reduced to the primary parse function +ParseFile, and a couple of +convenience functions ParseDir +and ParseExpr. +

+ +

+The type names of the go/doc package have been +streamlined by removing the Doc suffix: PackageDoc +is now Package, ValueDoc is Value, etc. +Also, all types now consistently have a Name field (or Names, +in the case of type Value), Type.Factories has become +Type.Funcs, and there is a new type Method that describes +methods in more detail. +Instead of calling doc.NewPackageDoc(pkg, importpath), +documentation for a package is created with: +

+ +
+    doc.New(pkg, importpath, mode)
+
+ +

+where the new mode parameter specifies the operation mode: +if set to AllDecls, all declarations +(not just exported ones) are considered. +The function NewFileDoc was removed, and the function +CommentText has become the method +Text of +ast.CommentGroup. +

+ +

+In package go/token, the +token.FileSet method Files +(which originally returned a channel of *token.Files) has been replaced +with the iterator Iterate that +accepts a function argument instead. +

+ +

+Updating: +Code that uses packages in go will have to be updated by hand; the +compiler will reject incorrect uses. Templates used in conjuction with any of the +go/doc types may need manual fixes; the renamed fields will lead +to run-time errors. +

+

The package tree exp

diff --git a/doc/go1.tmpl b/doc/go1.tmpl index 40bd7cba93..d8419f8459 100644 --- a/doc/go1.tmpl +++ b/doc/go1.tmpl @@ -822,6 +822,70 @@ and os.FileMode API. Code that needs system-specific file details will need to be updated by hand.

+

The package tree go

+ +

+Several packages under go have slightly revised APIs. +

+ +

+The modes AllowIllegalChars and InsertSemis have been removed +from the go/scanner package. They were mostly +useful for scanning text other then Go source files. Instead, the +text/scanner package should be used +for that purpose. +

+ +

+The set of parse functions provided by the go/parser +package has been reduced to the primary parse function +ParseFile, and a couple of +convenience functions ParseDir +and ParseExpr. +

+ +

+The type names of the go/doc package have been +streamlined by removing the Doc suffix: PackageDoc +is now Package, ValueDoc is Value, etc. +Also, all types now consistently have a Name field (or Names, +in the case of type Value), Type.Factories has become +Type.Funcs, and there is a new type Method that describes +methods in more detail. +Instead of calling doc.NewPackageDoc(pkg, importpath), +documentation for a package is created with: +

+ +
+    doc.New(pkg, importpath, mode)
+
+ +

+where the new mode parameter specifies the operation mode: +if set to AllDecls, all declarations +(not just exported ones) are considered. +The function NewFileDoc was removed, and the function +CommentText has become the method +Text of +ast.CommentGroup. +

+ +

+In package go/token, the +token.FileSet method Files +(which originally returned a channel of *token.Files) has been replaced +with the iterator Iterate that +accepts a function argument instead. +

+ +

+Updating: +Code that uses packages in go will have to be updated by hand; the +compiler will reject incorrect uses. Templates used in conjuction with any of the +go/doc types may need manual fixes; the renamed fields will lead +to run-time errors. +

+

The package tree exp