Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func main() {
"don't read files that contain the given comma-separated strings (use to avoid /testdata, etc) ")
// hack for testing code with build flags
flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", "a list of build tags")
var ci = flag.Bool("ci", false, "Enables non zero exit code if any dead code is found during analysis")
flag.Parse()
// handle ignore list
ucf.Ignore = strings.Split(ignoreList, ",")
Expand Down Expand Up @@ -54,4 +55,7 @@ func main() {
for _, o := range unusedObjects {
fmt.Printf("%s\n", o)
}
if *ci {
os.Exit(len(unusedObjects))
}
}