Skip to content

Commit ec2133c

Browse files
committed
lint: golangci: format with gofmt -s
1 parent da1bc93 commit ec2133c

File tree

1 file changed

+31
-17
lines changed

1 file changed

+31
-17
lines changed

strip.go

+31-17
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ var htmlNormReplacementTable = []string{
9393
// <div id=d></div>
9494
// <script>(function () {
9595
// var a = [], d = document.getElementById("d"), i, c, s;
96-
// for (i = 0; i < 0x10000; ++i) {
97-
// c = String.fromCharCode(i);
98-
// d.innerHTML = "<span title=" + c + "lt" + c + "></span>"
99-
// s = d.getElementsByTagName("SPAN")[0];
100-
// if (!s || s.title !== c + "lt" + c) { a.push(i.toString(16)); }
101-
// }
96+
//
97+
// for (i = 0; i < 0x10000; ++i) {
98+
// c = String.fromCharCode(i);
99+
// d.innerHTML = "<span title=" + c + "lt" + c + "></span>"
100+
// s = d.getElementsByTagName("SPAN")[0];
101+
// if (!s || s.title !== c + "lt" + c) { a.push(i.toString(16)); }
102+
// }
103+
//
102104
// document.write(a.join(", "));
103105
// })()</script>
104106
var htmlNospaceReplacementTable = []string{
@@ -335,7 +337,9 @@ func (c context) mangle(templateName string) string {
335337
// HTML5 parsing algorithm because a single token production in the HTML
336338
// grammar may contain embedded actions in a template. For instance, the quoted
337339
// HTML attribute produced by
338-
// <div title="Hello {{.World}}">
340+
//
341+
// <div title="Hello {{.World}}">
342+
//
339343
// is a single token in HTML's grammar but in a template spans several nodes.
340344
type state uint8
341345

@@ -936,13 +940,19 @@ func newIdentCmd(identifier string, pos parse.Pos) *parse.CommandNode {
936940
// nudge returns the context that would result from following empty string
937941
// transitions from the input context.
938942
// For example, parsing:
939-
// `<a href=`
943+
//
944+
// `<a href=`
945+
//
940946
// will end in context{stateBeforeValue, attrURL}, but parsing one extra rune:
941-
// `<a href=x`
947+
//
948+
// `<a href=x`
949+
//
942950
// will end in context{stateURL, delimSpaceOrTagEnd, ...}.
943951
// There are two transitions that happen when the 'x' is seen:
944952
// (1) Transition from a before-value state to a start-of-value state without
945-
// consuming any character.
953+
//
954+
// consuming any character.
955+
//
946956
// (2) Consume 'x' and transition past the first value character.
947957
// In this case, nudging produces the context after (1) happens.
948958
func nudge(c context) context {
@@ -1973,14 +1983,17 @@ type ErrorCode int
19731983
//
19741984
// Output: "ZgotmplZ"
19751985
// Example:
1976-
// <img src="{{.X}}">
1977-
// where {{.X}} evaluates to `javascript:...`
1986+
//
1987+
// <img src="{{.X}}">
1988+
// where {{.X}} evaluates to `javascript:...`
1989+
//
19781990
// Discussion:
1979-
// "ZgotmplZ" is a special value that indicates that unsafe content reached a
1980-
// CSS or URL context at runtime. The output of the example will be
1981-
// <img src="#ZgotmplZ">
1982-
// If the data comes from a trusted source, use content types to exempt it
1983-
// from filtering: URL(`javascript:...`).
1991+
//
1992+
// "ZgotmplZ" is a special value that indicates that unsafe content reached a
1993+
// CSS or URL context at runtime. The output of the example will be
1994+
// <img src="#ZgotmplZ">
1995+
// If the data comes from a trusted source, use content types to exempt it
1996+
// from filtering: URL(`javascript:...`).
19841997
const (
19851998
// OK indicates the lack of an error.
19861999
OK ErrorCode = iota
@@ -3523,6 +3536,7 @@ func (t *Template) Lookup(name string) *Template {
35233536
// Must is a helper that wraps a call to a function returning (*Template, error)
35243537
// and panics if the error is non-nil. It is intended for use in variable initializations
35253538
// such as
3539+
//
35263540
// var t = template.Must(template.New("name").Parse("html"))
35273541
func Must(t *Template, err error) *Template {
35283542
if err != nil {

0 commit comments

Comments
 (0)