summaryrefslogtreecommitdiff
path: root/src/pkg/template/template.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
commit9aad19327eb719775a874f8f18bb15958db1d471 (patch)
treec515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/template/template.go
parent073e240233589933c43143c997247c33206bb066 (diff)
downloadgolang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz
- replaced gofmt expression formatting algorithm with
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
Diffstat (limited to 'src/pkg/template/template.go')
-rw-r--r--src/pkg/template/template.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pkg/template/template.go b/src/pkg/template/template.go
index 548c70619..9a819db61 100644
--- a/src/pkg/template/template.go
+++ b/src/pkg/template/template.go
@@ -220,7 +220,7 @@ func (t *Template) nextItem() []byte {
sawLeft := false; // are we waiting for an opening delimiter?
special := false; // is this a {.foo} directive, which means trim white space?
// Delete surrounding white space if this {.foo} is the only thing on the line.
- trim_white := t.p == 0 || t.buf[t.p - 1] == '\n';
+ trim_white := t.p == 0 || t.buf[t.p-1] == '\n';
only_white := true; // we have seen only white space so far
var i int;
start := t.p;
@@ -239,7 +239,7 @@ Loop:
break Loop
}
// is it a directive or comment?
- j := i+len(t.ldelim); // position after delimiter
+ j := i + len(t.ldelim); // position after delimiter
if j+1 < len(t.buf) && (t.buf[j] == '.' || t.buf[j] == '#') {
special = true;
if trim_white && only_white {
@@ -249,7 +249,7 @@ Loop:
break Loop
}
sawLeft = true;
- i = j-1;
+ i = j - 1;
case equal(t.buf, i, t.rdelim):
if !sawLeft {
t.parseError("unmatched closing delimiter");
@@ -681,13 +681,13 @@ func (t *Template) executeElement(i int, st *state) int {
switch elem := t.elems.At(i).(type) {
case *textElement:
st.wr.Write(elem.text);
- return i+1;
+ return i + 1;
case *literalElement:
st.wr.Write(elem.text);
- return i+1;
+ return i + 1;
case *variableElement:
t.writeVariable(elem, st);
- return i+1;
+ return i + 1;
case *sectionElement:
t.executeSection(elem, st);
return elem.end;
@@ -744,7 +744,7 @@ func iter(v reflect.Value) *reflect.ChanValue {
continue
}
ct, ok := ft.Out(0).(*reflect.ChanType);
- if !ok || ct.Dir() & reflect.RecvDir == 0 {
+ if !ok || ct.Dir()&reflect.RecvDir == 0 {
continue
}
return fv.Call(nil)[0].(*reflect.ChanValue);