Categorygithub.com/orijtech/sigchanyzer
modulepackage
0.0.2
Repository: https://github.com/orijtech/sigchanyzer.git
Documentation: pkg.go.dev

# README

sigchanyzer

Build status

Package sigchanyzer defines an Analyzer that checks usage of unbuffered os.Signal channel, which can be at risk of missing the signal.

Installation

With Go modules:

go get github.com/orijtech/sigchanyzer/cmd/sigchanyzer

Without Go modules:

$ cd $GOPATH/src/github.com/orijtech/sigchanyzer
$ git checkout v0.0.2
$ go get
$ install ./cmd/sigchanyzer

Usage

You can run sigchanyzer either on a Go package or Go files, the same way as other Go tools work.

Example:

$ sigchanyzer github.com/orijtech/sigchanyzer/testdata/src/a

or:

$ sigchanyzer ./testdata/src/a/a.go

Sample output:

/go/src/github.com/orijtech/sigchanyzer/testdata/a/a.go:16:7: unbuffered os.Signal channel
/go/src/github.com/orijtech/sigchanyzer/testdata/a/a.go:22:7: unbuffered os.Signal channel

Development

Go 1.15+

Running test

Add test case to testdata/src/a directory, then run:

go test

Contributing

All contributions are welcome, please report bug or open a pull request.

# Packages

No description provided by the author

# Constants

No description provided by the author

# Variables

Analyzer describes struct slop analysis function detector.