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 /
sort /
[ HOME SHELL ]
Name
Size
Permission
Action
example_interface_test.go
1.47
KB
-rw-r--r--
example_keys_test.go
2.68
KB
-rw-r--r--
example_multi_test.go
4.05
KB
-rw-r--r--
example_search_test.go
1.16
KB
-rw-r--r--
example_test.go
2.85
KB
-rw-r--r--
example_wrapper_test.go
1.63
KB
-rw-r--r--
export_test.go
239
B
-rw-r--r--
genzfunc.go
2.91
KB
-rw-r--r--
search.go
4.14
KB
-rw-r--r--
search_test.go
4.25
KB
-rw-r--r--
slice.go
1.26
KB
-rw-r--r--
slice_go113.go
305
B
-rw-r--r--
slice_go14.go
468
B
-rw-r--r--
slice_go18.go
291
B
-rw-r--r--
sort.go
15.8
KB
-rw-r--r--
sort_test.go
15.09
KB
-rw-r--r--
zfuncversion.go
4.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : genzfunc.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. // +build ignore // This program is run via "go generate" (via a directive in sort.go) // to generate zfuncversion.go. // // It copies sort.go to zfuncversion.go, only retaining funcs which // take a "data Interface" parameter, and renaming each to have a // "_func" suffix and taking a "data lessSwap" instead. It then rewrites // each internal function call to the appropriate _func variants. package main import ( "bytes" "go/ast" "go/format" "go/parser" "go/token" "io/ioutil" "log" "regexp" ) var fset = token.NewFileSet() func main() { af, err := parser.ParseFile(fset, "sort.go", nil, 0) if err != nil { log.Fatal(err) } af.Doc = nil af.Imports = nil af.Comments = nil var newDecl []ast.Decl for _, d := range af.Decls { fd, ok := d.(*ast.FuncDecl) if !ok { continue } if fd.Recv != nil || fd.Name.IsExported() { continue } typ := fd.Type if len(typ.Params.List) < 1 { continue } arg0 := typ.Params.List[0] arg0Name := arg0.Names[0].Name arg0Type := arg0.Type.(*ast.Ident) if arg0Name != "data" || arg0Type.Name != "Interface" { continue } arg0Type.Name = "lessSwap" newDecl = append(newDecl, fd) } af.Decls = newDecl ast.Walk(visitFunc(rewriteCalls), af) var out bytes.Buffer if err := format.Node(&out, fset, af); err != nil { log.Fatalf("format.Node: %v", err) } // Get rid of blank lines after removal of comments. src := regexp.MustCompile(`\n{2,}`).ReplaceAll(out.Bytes(), []byte("\n")) // Add comments to each func, for the lost reader. // This is so much easier than adding comments via the AST // and trying to get position info correct. src = regexp.MustCompile(`(?m)^func (\w+)`).ReplaceAll(src, []byte("\n// Auto-generated variant of sort.go:$1\nfunc ${1}_func")) // Final gofmt. src, err = format.Source(src) if err != nil { log.Fatalf("format.Source: %v on\n%s", err, src) } out.Reset() out.WriteString(`// Code generated from sort.go using genzfunc.go; DO NOT EDIT. // 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. `) out.Write(src) const target = "zfuncversion.go" if err := ioutil.WriteFile(target, out.Bytes(), 0644); err != nil { log.Fatal(err) } } type visitFunc func(ast.Node) ast.Visitor func (f visitFunc) Visit(n ast.Node) ast.Visitor { return f(n) } func rewriteCalls(n ast.Node) ast.Visitor { ce, ok := n.(*ast.CallExpr) if ok { rewriteCall(ce) } return visitFunc(rewriteCalls) } func rewriteCall(ce *ast.CallExpr) { ident, ok := ce.Fun.(*ast.Ident) if !ok { // e.g. skip SelectorExpr (data.Less(..) calls) return } // skip casts if ident.Name == "int" || ident.Name == "uint" { return } if len(ce.Args) < 1 { return } ident.Name += "_func" }
Close