sigchanyzer

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Documentation

Index

Constants

View Source
const Doc = `check for unbuffered channel of os.Signal, which can be at risk of missing the signal.`

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "sigchanyzer",
	Doc:      Doc,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer describes struct slop analysis function detector.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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