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 /
go /
types /
[ HOME SHELL ]
Name
Size
Permission
Action
testdata
[ DIR ]
drwxr-xr-x
api.go
13.6
KB
-rw-r--r--
api_test.go
41.52
KB
-rw-r--r--
assignments.go
8.58
KB
-rw-r--r--
builtins.go
17.25
KB
-rw-r--r--
builtins_test.go
7.54
KB
-rw-r--r--
call.go
13.86
KB
-rw-r--r--
check.go
12.43
KB
-rw-r--r--
check_test.go
8.65
KB
-rw-r--r--
conversions.go
4.86
KB
-rw-r--r--
decl.go
22.25
KB
-rw-r--r--
errors.go
3.14
KB
-rw-r--r--
eval.go
2.92
KB
-rw-r--r--
eval_test.go
7.12
KB
-rw-r--r--
example_test.go
8.77
KB
-rw-r--r--
expr.go
44.32
KB
-rw-r--r--
exprstring.go
4.54
KB
-rw-r--r--
exprstring_test.go
1.76
KB
-rw-r--r--
gccgosizes.go
1016
B
-rw-r--r--
gotype.go
8.4
KB
-rw-r--r--
hilbert_test.go
3.63
KB
-rw-r--r--
initorder.go
8.84
KB
-rw-r--r--
issues_test.go
12.86
KB
-rw-r--r--
labels.go
7.01
KB
-rw-r--r--
lookup.go
13.05
KB
-rw-r--r--
methodset.go
8.38
KB
-rw-r--r--
object.go
14.69
KB
-rw-r--r--
object_test.go
2.82
KB
-rw-r--r--
objset.go
927
B
-rw-r--r--
operand.go
7.46
KB
-rw-r--r--
package.go
2.19
KB
-rw-r--r--
predicates.go
9.01
KB
-rw-r--r--
resolver.go
20.76
KB
-rw-r--r--
resolver_test.go
4.58
KB
-rw-r--r--
return.go
4.23
KB
-rw-r--r--
scope.go
5.48
KB
-rw-r--r--
selection.go
3.99
KB
-rw-r--r--
self_test.go
2.2
KB
-rw-r--r--
sizes.go
6.61
KB
-rw-r--r--
sizes_test.go
2.46
KB
-rw-r--r--
stdlib_test.go
8.32
KB
-rw-r--r--
stmt.go
22.8
KB
-rw-r--r--
token_test.go
1.21
KB
-rw-r--r--
type.go
16.81
KB
-rw-r--r--
typestring.go
7.8
KB
-rw-r--r--
typestring_test.go
6.56
KB
-rw-r--r--
typexpr.go
20.6
KB
-rw-r--r--
universe.go
6.47
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : resolver_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 types_test import ( "fmt" "go/ast" "go/importer" "go/parser" "go/token" "internal/testenv" "sort" "testing" . "go/types" ) type resolveTestImporter struct { importer ImporterFrom imported map[string]bool } func (imp *resolveTestImporter) Import(string) (*Package, error) { panic("should not be called") } func (imp *resolveTestImporter) ImportFrom(path, srcDir string, mode ImportMode) (*Package, error) { if mode != 0 { panic("mode must be 0") } if imp.importer == nil { imp.importer = importer.Default().(ImporterFrom) imp.imported = make(map[string]bool) } pkg, err := imp.importer.ImportFrom(path, srcDir, mode) if err != nil { return nil, err } imp.imported[path] = true return pkg, nil } func TestResolveIdents(t *testing.T) { testenv.MustHaveGoBuild(t) sources := []string{ ` package p import "fmt" import "math" const pi = math.Pi func sin(x float64) float64 { return math.Sin(x) } var Println = fmt.Println `, ` package p import "fmt" type errorStringer struct { fmt.Stringer; error } func f() string { _ = "foo" return fmt.Sprintf("%d", g()) } func g() (x int) { return } `, ` package p import . "go/parser" import "sync" func h() Mode { return ImportsOnly } var _, x int = 1, 2 func init() {} type T struct{ *sync.Mutex; a, b, c int} type I interface{ m() } var _ = T{a: 1, b: 2, c: 3} func (_ T) m() {} func (T) _() {} var i I var _ = i.m func _(s []int) { for i, x := range s { _, _ = i, x } } func _(x interface{}) { switch x := x.(type) { case int: _ = x } switch {} // implicit 'true' tag } `, ` package p type S struct{} func (T) _() {} func (T) _() {} `, ` package p func _() { L0: L1: goto L0 for { goto L1 } if true { goto L2 } L2: } `, } pkgnames := []string{ "fmt", "math", } // parse package files fset := token.NewFileSet() var files []*ast.File for i, src := range sources { f, err := parser.ParseFile(fset, fmt.Sprintf("sources[%d]", i), src, parser.DeclarationErrors) if err != nil { t.Fatal(err) } files = append(files, f) } // resolve and type-check package AST importer := new(resolveTestImporter) conf := Config{Importer: importer} uses := make(map[*ast.Ident]Object) defs := make(map[*ast.Ident]Object) _, err := conf.Check("testResolveIdents", fset, files, &Info{Defs: defs, Uses: uses}) if err != nil { t.Fatal(err) } // check that all packages were imported for _, name := range pkgnames { if !importer.imported[name] { t.Errorf("package %s not imported", name) } } // check that qualified identifiers are resolved for _, f := range files { ast.Inspect(f, func(n ast.Node) bool { if s, ok := n.(*ast.SelectorExpr); ok { if x, ok := s.X.(*ast.Ident); ok { obj := uses[x] if obj == nil { t.Errorf("%s: unresolved qualified identifier %s", fset.Position(x.Pos()), x.Name) return false } if _, ok := obj.(*PkgName); ok && uses[s.Sel] == nil { t.Errorf("%s: unresolved selector %s", fset.Position(s.Sel.Pos()), s.Sel.Name) return false } return false } return false } return true }) } for id, obj := range uses { if obj == nil { t.Errorf("%s: Uses[%s] == nil", fset.Position(id.Pos()), id.Name) } } // check that each identifier in the source is found in uses or defs or both var both []string for _, f := range files { ast.Inspect(f, func(n ast.Node) bool { if x, ok := n.(*ast.Ident); ok { var objects int if _, found := uses[x]; found { objects |= 1 delete(uses, x) } if _, found := defs[x]; found { objects |= 2 delete(defs, x) } if objects == 0 { t.Errorf("%s: unresolved identifier %s", fset.Position(x.Pos()), x.Name) } else if objects == 3 { both = append(both, x.Name) } return false } return true }) } // check the expected set of idents that are simultaneously uses and defs sort.Strings(both) if got, want := fmt.Sprint(both), "[Mutex Stringer error]"; got != want { t.Errorf("simultaneous uses/defs = %s, want %s", got, want) } // any left-over identifiers didn't exist in the source for x := range uses { t.Errorf("%s: identifier %s not present in source", fset.Position(x.Pos()), x.Name) } for x := range defs { t.Errorf("%s: identifier %s not present in source", fset.Position(x.Pos()), x.Name) } // TODO(gri) add tests to check ImplicitObj callbacks }
Close