goinspect

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 13 Imported by: 0

README

goinspect

individual inspection command

install

$ go install github.com/podhmo/goinspect/cmd/goinspect@latest

how to use

$ goinspect --pkg ./internal/x/... --only F --include-unexported
package github.com/podhmo/goinspect/internal/x

  func x.F(s x.S)
    func x.log() func()
    func x.F0()
      func x.log() func()
      func x.F1()
        func x.H()
    func x.H()

./internal/x/func.go

inspired by

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(w io.Writer, c *Config, g *Graph, nodes []*Node) error

func DumpAll

func DumpAll(w io.Writer, c *Config, g *Graph) error

Types

type Config

type Config struct {
	Fset *token.FileSet

	PkgPath    string
	Padding    string
	TrimPrefix string

	ExpandAll         bool
	IncludeUnexported bool
	OtherPackages     []string

	Debug bool
	// contains filtered or unexported fields
}

func (*Config) NeedName

func (c *Config) NeedName(name string) bool

type Graph

type Graph = graph.Graph[string, *Subject]

func Scan

func Scan(c *Config, pkgs []*packages.Package) (*Graph, error)

type Kind added in v0.1.1

type Kind string
const (
	KindFunc   Kind = "F"
	KindObject Kind = "O"
	KindMethod Kind = "M"
)

type Node

type Node = graph.Node[*Subject]

type Scanner

type Scanner struct {
	Config *Config
	// contains filtered or unexported fields
}

func (*Scanner) Scan

func (s *Scanner) Scan(pkg *packages.Package, t *ast.File) error

type Subject

type Subject struct {
	ID     string
	Object types.Object
	Recv   string // if method, this value is not zero
	Kind   Kind
}

Directories

Path Synopsis
cmd
internal
x

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL