Skip to content

radeksimko/go-refs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-refs

Have you ever built a Go package which others depend on and need to understand how to best approach refactoring to limit breaking your external interface?

i.e. Do you need to know which exposed parts of your package are in use?

Go-refs uses Go's AST package to parse a (go) file and list any identifiers which are in use from a given import path.

Usage

go list -json ./... \
  | jq -r '.Dir + "/" + .GoFiles[]' \
  | xargs -n1 go-refs -pkg github.com/hashicorp/terraform/helper/schema \
  | sort | uniq -c | sort -nr
5313 TypeString
2652 ResourceData
2010 Resource
1947 Schema
 920 Set
 658 TypeList
 597 TypeInt
 561 TypeBool
 524 TypeSet
...

About

Parses a file and lists any identifiers which are in use from a given import path.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages