Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
html /
template /
[ HOME SHELL ]
Name
Size
Permission
Action
attr.go
6.24
KB
-rw-r--r--
attr_string.go
413
B
-rw-r--r--
clone_test.go
8
KB
-rw-r--r--
content.go
6.26
KB
-rw-r--r--
content_test.go
13.29
KB
-rw-r--r--
context.go
8.18
KB
-rw-r--r--
css.go
7
KB
-rw-r--r--
css_test.go
6.91
KB
-rw-r--r--
delim_string.go
416
B
-rw-r--r--
doc.go
7.67
KB
-rw-r--r--
element_string.go
445
B
-rw-r--r--
error.go
8.87
KB
-rw-r--r--
escape.go
29.05
KB
-rw-r--r--
escape_test.go
50.26
KB
-rw-r--r--
example_test.go
3.93
KB
-rw-r--r--
examplefiles_test.go
7.47
KB
-rw-r--r--
html.go
7.31
KB
-rw-r--r--
html_test.go
2.81
KB
-rw-r--r--
js.go
11.52
KB
-rw-r--r--
js_test.go
11.65
KB
-rw-r--r--
jsctx_string.go
387
B
-rw-r--r--
state_string.go
755
B
-rw-r--r--
template.go
15.85
KB
-rw-r--r--
template_test.go
4.55
KB
-rw-r--r--
transition.go
15.18
KB
-rw-r--r--
transition_test.go
1.71
KB
-rw-r--r--
url.go
6.7
KB
-rw-r--r--
url_test.go
3.88
KB
-rw-r--r--
urlpart_string.go
436
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : template_test.go
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package template_test import ( "bytes" . "html/template" "strings" "testing" ) func TestTemplateClone(t *testing.T) { // https://golang.org/issue/12996 orig := New("name") clone, err := orig.Clone() if err != nil { t.Fatal(err) } if len(clone.Templates()) != len(orig.Templates()) { t.Fatalf("Invalid length of t.Clone().Templates()") } const want = "stuff" parsed := Must(clone.Parse(want)) var buf bytes.Buffer err = parsed.Execute(&buf, nil) if err != nil { t.Fatal(err) } if got := buf.String(); got != want { t.Fatalf("got %q; want %q", got, want) } } func TestRedefineNonEmptyAfterExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `foo`) c.mustExecute(c.root, nil, "foo") c.mustNotParse(c.root, `bar`) } func TestRedefineEmptyAfterExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, ``) c.mustExecute(c.root, nil, "") c.mustNotParse(c.root, `foo`) c.mustExecute(c.root, nil, "") } func TestRedefineAfterNonExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `{{if .}}<{{template "X"}}>{{end}}{{define "X"}}foo{{end}}`) c.mustExecute(c.root, 0, "") c.mustNotParse(c.root, `{{define "X"}}bar{{end}}`) c.mustExecute(c.root, 1, "<foo>") } func TestRedefineAfterNamedExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `<{{template "X" .}}>{{define "X"}}foo{{end}}`) c.mustExecute(c.root, nil, "<foo>") c.mustNotParse(c.root, `{{define "X"}}bar{{end}}`) c.mustExecute(c.root, nil, "<foo>") } func TestRedefineNestedByNameAfterExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `{{define "X"}}foo{{end}}`) c.mustExecute(c.lookup("X"), nil, "foo") c.mustNotParse(c.root, `{{define "X"}}bar{{end}}`) c.mustExecute(c.lookup("X"), nil, "foo") } func TestRedefineNestedByTemplateAfterExecution(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `{{define "X"}}foo{{end}}`) c.mustExecute(c.lookup("X"), nil, "foo") c.mustNotParse(c.lookup("X"), `bar`) c.mustExecute(c.lookup("X"), nil, "foo") } func TestRedefineSafety(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `<html><a href="{{template "X"}}">{{define "X"}}{{end}}`) c.mustExecute(c.root, nil, `<html><a href="">`) // Note: Every version of Go prior to Go 1.8 accepted the redefinition of "X" // on the next line, but luckily kept it from being used in the outer template. // Now we reject it, which makes clearer that we're not going to use it. c.mustNotParse(c.root, `{{define "X"}}" bar="baz{{end}}`) c.mustExecute(c.root, nil, `<html><a href="">`) } func TestRedefineTopUse(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `{{template "X"}}{{.}}{{define "X"}}{{end}}`) c.mustExecute(c.root, 42, `42`) c.mustNotParse(c.root, `{{define "X"}}<script>{{end}}`) c.mustExecute(c.root, 42, `42`) } func TestRedefineOtherParsers(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, ``) c.mustExecute(c.root, nil, ``) if _, err := c.root.ParseFiles("no.template"); err == nil || !strings.Contains(err.Error(), "Execute") { t.Errorf("ParseFiles: %v\nwanted error about already having Executed", err) } if _, err := c.root.ParseGlob("*.no.template"); err == nil || !strings.Contains(err.Error(), "Execute") { t.Errorf("ParseGlob: %v\nwanted error about already having Executed", err) } if _, err := c.root.AddParseTree("t1", c.root.Tree); err == nil || !strings.Contains(err.Error(), "Execute") { t.Errorf("AddParseTree: %v\nwanted error about already having Executed", err) } } func TestNumbers(t *testing.T) { c := newTestCase(t) c.mustParse(c.root, `{{print 1_2.3_4}} {{print 0x0_1.e_0p+02}}`) c.mustExecute(c.root, nil, "12.34 7.5") } type testCase struct { t *testing.T root *Template } func newTestCase(t *testing.T) *testCase { return &testCase{ t: t, root: New("root"), } } func (c *testCase) lookup(name string) *Template { return c.root.Lookup(name) } func (c *testCase) mustParse(t *Template, text string) { _, err := t.Parse(text) if err != nil { c.t.Fatalf("parse: %v", err) } } func (c *testCase) mustNotParse(t *Template, text string) { _, err := t.Parse(text) if err == nil { c.t.Fatalf("parse: unexpected success") } } func (c *testCase) mustExecute(t *Template, val interface{}, want string) { var buf bytes.Buffer err := t.Execute(&buf, val) if err != nil { c.t.Fatalf("execute: %v", err) } if buf.String() != want { c.t.Fatalf("template output:\n%s\nwant:\n%s", buf.String(), want) } }
Close