Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/divan/depscheck
/ functions
Functions
78 in github.com/divan/depscheck
⨍
Functions
78
◇
Types & classes
12
↓ 17 callers
Function
checkSelector
(src string, t *testing.T, r *Result, fn string, count, loc, loccum, depth, depthint int)
deps_test.go:123
↓ 14 callers
Function
checkCount
(src string, t *testing.T, r *Result, want int)
deps_test.go:117
↓ 14 callers
Function
getResult
(t *testing.T, isInternal bool, name string, sources ...string)
deps_test.go:105
↓ 9 callers
Method
ID
ID generates uniqie string ID for this selector.
selector.go:42
↓ 6 callers
Function
IsStdlib
IsStdlib attempts to check if package belongs to stdlib.
package.go:56
↓ 5 callers
Method
Bar
()
test/sample/sample.go:27
↓ 5 callers
Method
Depth
Depth returns Depth for Selector and all it's external dependencies.
selector.go:80
↓ 5 callers
Method
DepthInternal
DepthInternal returns Depth for Selector and all it's internal dependencies.
selector.go:97
↓ 5 callers
Method
LOCCum
LOCCum returns cumulative LOC count for Selector and all it's dependencies.
selector.go:66
↓ 4 callers
Method
Append
Append adds new Selector to Deps.
selector.go:143
↓ 4 callers
Function
IsInternal
IsInternal returns true if subpkg is a subpackage of pkg.
package.go:31
↓ 3 callers
Method
All
All returns all known selectors in result.
result.go:94
↓ 3 callers
Method
IsFunc
IsFunc returns true if Selector is either a function or a method.
selector.go:114
↓ 3 callers
Method
PackagesStats
PackagesStats returns stats by packages in all selectors.
pkgstats.go:32
↓ 3 callers
Method
WalkObject
WalkObject builds Selector from the given pkg and object. It recursively goes into nested functions/calls adding it as Deps.
walker.go:94
↓ 2 callers
Method
Foo
(int)
test/foo/foo.go:10
↓ 2 callers
Function
NewSelector
NewSelector creates new Selector.
selector.go:50
↓ 2 callers
Function
NewWalker
NewWalker inits new AST walker.
walker.go:25
↓ 2 callers
Method
TopWalk
TopWalk walks the initial package, looking only for selectors from imported packages.
walker.go:55
↓ 1 callers
Method
Add
Add adds new selector to the result.
result.go:25
↓ 1 callers
Function
Bar
(x int)
test/bar/bar.go:3
↓ 1 callers
Method
CanBeAvoided
CanBeAvoided attempts to classify if package usage is small enough to suggest user to avoid this package as a dependency and instead copy/embed it's c
pkgstats.go:57
↓ 1 callers
Method
FindDefDecl
FindDefDecl searches for declaration and definition for the given object.
walker.go:191
↓ 1 callers
Method
FnDecl
FnDecl searches for the FuncDecl based on ast.Ident node.
walker.go:205
↓ 1 callers
Function
Foo
(x int)
test/bar/bar.go:9
↓ 1 callers
Method
HasRecursion
HasRecursion attempts to find selector in nested dependencies to avoid recursion.
selector.go:154
↓ 1 callers
Method
LOC
LOC calculates readl Lines Of Code for the given function node. node must be ast.FuncDecl, panics otherwise.
walker.go:224
↓ 1 callers
Method
LookupObject
LookupObject searches for the object in current package by ast.Ident node.
walker.go:251
↓ 1 callers
Function
NewPackage
NewPackage creates new Package.
package.go:17
↓ 1 callers
Function
NewPackageStat
NewPackageStat creates new PackageStat.
pkgstats.go:20
↓ 1 callers
Function
NewResult
NewResult inits new Result.
result.go:17
↓ 1 callers
Method
PrintPackagesStats
PrintPackagesStats prints package stats to stdout in a pretty table form.
result.go:69
↓ 1 callers
Method
PrintStats
PrintStats prints results to stdout in a pretty table form.
result.go:34
↓ 1 callers
Function
SampleFunc
()
test/sample/sample.go:7
↓ 1 callers
Method
String
String implements Stringer for Totals type.
result.go:159
↓ 1 callers
Method
Suggestions
Suggestions analyzes results and print suggestions on deps. It attempts to suggest which dependencies could be copied to your source because of its s
result.go:113
↓ 1 callers
Method
Totals
Totals computes Totals for Result.
result.go:144
↓ 1 callers
Method
WalkFuncBody
WalkFuncBody searches for all internal or external selectors, used in a given function. It recursively goes into it, building Deps slice.
walker.go:157
↓ 1 callers
Method
WalkPackage
WalkPackage looks for dependencies used in a given package and saves selectors to result. It should be called for the top-level package only. Only ex
walker.go:68
↓ 1 callers
Function
Xfunc
()
test/sample/sample.go:15
↓ 1 callers
Function
YFunc
()
test/sample/sample.go:22
↓ 1 callers
Function
getStdPkgs
getStdPkgs tries to get list of stdlib packages by reading GOROOT This approach is used by "go list std" tool Based on go/cmd function matchPackages
package.go:72
↓ 1 callers
Method
printDeps
(depth int)
selector.go:123
↓ 1 callers
Function
printType
(t types.Type)
walker.go:261
Function
Bar
(x int)
test/recursion.go:14
Function
BenchmarkIsInternal
(b *testing.B)
package_test.go:36
Function
BenchmarkIsStdlibFalse
(b *testing.B)
package_test.go:30
Function
BenchmarkIsStdlibTrue
(b *testing.B)
package_test.go:25
Function
Foo
(foo foo.Fooer)
test/interface.go:5
Function
Foo
(x int)
test/recursion.go:8
Function
Foo
(x int)
test/foo/foo.go:13
Method
Len
()
selector.go:133
Method
Len
()
pkgstats.go:83
Method
Less
(i, j int)
selector.go:135
Method
Less
(i, j int)
pkgstats.go:85
Method
PrintDeps
PrintDeps recursively prints deps for selector.
selector.go:119
Method
PrintDeps
PrintDeps recursively print deps for all selectors found.
result.go:103
Method
String
String implements Stringer interface for Selector.
selector.go:27
Method
String
String implements Stringer for PackageStat.
pkgstats.go:27
Method
Swap
(i, j int)
selector.go:134
Method
Swap
(i, j int)
pkgstats.go:84
Function
TestConsts
(t *testing.T)
deps_test.go:51
Function
TestExportedFuncs
(t *testing.T)
deps_test.go:8
Function
TestInterface
(t *testing.T)
deps_test.go:71
Function
TestInternal
(t *testing.T)
deps_test.go:82
Function
TestPackageChecks
(t *testing.T)
package_test.go:7
Function
TestRecursion
(t *testing.T)
deps_test.go:40
Function
TestVars
(t *testing.T)
deps_test.go:61
Function
Usage
Usage prints usage information for this program.
main.go:63
Function
Xtest
()
test/pkg_dot.go:7
Function
Xtest
()
test/exported2.go:7
Function
Xtest
()
test/pkg_renamed.go:7
Function
Xtest
()
test/exported.go:16
Function
init
()
package.go:24
Function
main
()
main.go:19
Function
main
()
test/const.go:8
Function
main
()
test/external.go:9
Function
main
()
test/var.go:8