Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
1cd272d1
Commit
1cd272d1
authored
Mar 08, 2012
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/go1: template packages have changed since r60
R=golang-dev, adg CC=golang-dev
https://golang.org/cl/5787049
parent
2b8a7add
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
go1.html
doc/go1.html
+32
-0
go1.tmpl
doc/go1.tmpl
+32
-0
No files found.
doc/go1.html
View file @
1cd272d1
...
@@ -1953,6 +1953,38 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
...
@@ -1953,6 +1953,38 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
</p>
</p>
<h3
id=
"templates"
>
The template packages
</h3>
<p>
The
<code>
template
</code>
and
<code>
exp/template/html
</code>
packages have moved to
<a
href=
"/pkg/text/template/"
><code>
text/template
</code></a>
and
<a
href=
"/pkg/html/template/"
><code>
html/template
</code></a>
.
More significant, the interface to these packages has been simplified.
The template language is the same, but the concept of "template set" is gone
and the functions and methods of the packages have changed accordingly,
often by elimination.
</p>
<p>
Instead of sets, a
<code>
Template
</code>
object
may contain multiple named template definitions,
in effect constructing
name spaces for template invocation.
A template can invoke any other template associated with it, but only those
templates associated with it.
The simplest way to associate templates is to parse them together, something
made easier with the new structure of the packages.
</p>
<p>
<em>
Updating
</em>
:
The imports will be updated by fix tool.
Single-template uses will be otherwise be largely unaffected.
Code that uses multiple templates in concert will need to be updated by hand.
The
<a
href=
"/pkg/text/template/#examples"
>
examples
</a>
in
the documentation for
<code>
text/template
</code>
can provide guidance.
</p>
<h3
id=
"testing"
>
The testing package
</h3>
<h3
id=
"testing"
>
The testing package
</h3>
<p>
<p>
...
...
doc/go1.tmpl
View file @
1cd272d1
...
@@ -1838,6 +1838,38 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
...
@@ -1838,6 +1838,38 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
</
p
>
</
p
>
<
h3
id
=
"templates"
>
The
template
packages
</
h3
>
<
p
>
The
<
code
>
template
</
code
>
and
<
code
>
exp
/
template
/
html
</
code
>
packages
have
moved
to
<
a
href
=
"/pkg/text/template/"
><
code
>
text
/
template
</
code
></
a
>
and
<
a
href
=
"/pkg/html/template/"
><
code
>
html
/
template
</
code
></
a
>.
More
significant
,
the
interface
to
these
packages
has
been
simplified
.
The
template
language
is
the
same
,
but
the
concept
of
"template set"
is
gone
and
the
functions
and
methods
of
the
packages
have
changed
accordingly
,
often
by
elimination
.
</
p
>
<
p
>
Instead
of
sets
,
a
<
code
>
Template
</
code
>
object
may
contain
multiple
named
template
definitions
,
in
effect
constructing
name
spaces
for
template
invocation
.
A
template
can
invoke
any
other
template
associated
with
it
,
but
only
those
templates
associated
with
it
.
The
simplest
way
to
associate
templates
is
to
parse
them
together
,
something
made
easier
with
the
new
structure
of
the
packages
.
</
p
>
<
p
>
<
em
>
Updating
</
em
>:
The
imports
will
be
updated
by
fix
tool
.
Single
-
template
uses
will
be
otherwise
be
largely
unaffected
.
Code
that
uses
multiple
templates
in
concert
will
need
to
be
updated
by
hand
.
The
<
a
href
=
"/pkg/text/template/#examples"
>
examples
</
a
>
in
the
documentation
for
<
code
>
text
/
template
</
code
>
can
provide
guidance
.
</
p
>
<
h3
id
=
"testing"
>
The
testing
package
</
h3
>
<
h3
id
=
"testing"
>
The
testing
package
</
h3
>
<
p
>
<
p
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment