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.1
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 /
cmd /
fix /
[ HOME SHELL ]
Name
Size
Permission
Action
cftype.go
3.5
KB
-rw-r--r--
cftype_test.go
2.43
KB
-rw-r--r--
context.go
510
B
-rw-r--r--
context_test.go
648
B
-rw-r--r--
doc.go
1.39
KB
-rw-r--r--
egltype.go
659
B
-rw-r--r--
egltype_test.go
1.98
KB
-rw-r--r--
fix.go
20.64
KB
-rw-r--r--
gotypes.go
1.7
KB
-rw-r--r--
gotypes_test.go
1.26
KB
-rw-r--r--
import_test.go
4.98
KB
-rw-r--r--
jnitype.go
1.24
KB
-rw-r--r--
jnitype_test.go
1.92
KB
-rw-r--r--
main.go
4.9
KB
-rw-r--r--
main_test.go
2.67
KB
-rw-r--r--
netipv6zone.go
1.32
KB
-rw-r--r--
netipv6zone_test.go
837
B
-rw-r--r--
printerconfig.go
1.11
KB
-rw-r--r--
printerconfig_test.go
748
B
-rw-r--r--
typecheck.go
19.7
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : main_test.go
// Copyright 2011 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 main import ( "go/ast" "go/parser" "strings" "testing" "cmd/internal/diff" ) type testCase struct { Name string Fn func(*ast.File) bool In string Out string } var testCases []testCase func addTestCases(t []testCase, fn func(*ast.File) bool) { // Fill in fn to avoid repetition in definitions. if fn != nil { for i := range t { if t[i].Fn == nil { t[i].Fn = fn } } } testCases = append(testCases, t...) } func fnop(*ast.File) bool { return false } func parseFixPrint(t *testing.T, fn func(*ast.File) bool, desc, in string, mustBeGofmt bool) (out string, fixed, ok bool) { file, err := parser.ParseFile(fset, desc, in, parserMode) if err != nil { t.Errorf("parsing: %v", err) return } outb, err := gofmtFile(file) if err != nil { t.Errorf("printing: %v", err) return } if s := string(outb); in != s && mustBeGofmt { t.Errorf("not gofmt-formatted.\n--- %s\n%s\n--- %s | gofmt\n%s", desc, in, desc, s) tdiff(t, in, s) return } if fn == nil { for _, fix := range fixes { if fix.f(file) { fixed = true } } } else { fixed = fn(file) } outb, err = gofmtFile(file) if err != nil { t.Errorf("printing: %v", err) return } return string(outb), fixed, true } func TestRewrite(t *testing.T) { for _, tt := range testCases { tt := tt t.Run(tt.Name, func(t *testing.T) { t.Parallel() // Apply fix: should get tt.Out. out, fixed, ok := parseFixPrint(t, tt.Fn, tt.Name, tt.In, true) if !ok { return } // reformat to get printing right out, _, ok = parseFixPrint(t, fnop, tt.Name, out, false) if !ok { return } if out != tt.Out { t.Errorf("incorrect output.\n") if !strings.HasPrefix(tt.Name, "testdata/") { t.Errorf("--- have\n%s\n--- want\n%s", out, tt.Out) } tdiff(t, out, tt.Out) return } if changed := out != tt.In; changed != fixed { t.Errorf("changed=%v != fixed=%v", changed, fixed) return } // Should not change if run again. out2, fixed2, ok := parseFixPrint(t, tt.Fn, tt.Name+" output", out, true) if !ok { return } if fixed2 { t.Errorf("applied fixes during second round") return } if out2 != out { t.Errorf("changed output after second round of fixes.\n--- output after first round\n%s\n--- output after second round\n%s", out, out2) tdiff(t, out, out2) } }) } } func tdiff(t *testing.T, a, b string) { data, err := diff.Diff("go-fix-test", []byte(a), []byte(b)) if err != nil { t.Error(err) return } t.Error(string(data)) }
Close