go-analyzers

module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT

README

go-analyzers

Static analyzers for Go to enforce code consistency and discourage bad practices.

Available analyzers

visibilityorder

Breaking code example:

image

Resulting compilation error:

image

onlyany

Forces the use of any (introduced in Go 1.8) instead of interface{}.

Installation (with Bazel)

In your WORKSPACE file:

http_archive(
    name = "com_github_dorfire_go_analyzers",
    sha256 = "2c07d07f67d7c402073548e8b1b36ffb23efa410d6958bacc4c12b02fcb1eac9",
    strip_prefix = "go-analyzers-master",
    urls = ["https://github.com/dorfire/go-analyzers/archive/refs/heads/master.tar.gz"],
)

In your NoGo target file (e.g. build/BUILD.bazel):

load("@io_bazel_rules_go//go:def.bzl", "nogo")

nogo(
    name = "nogo",
    # ...
    deps = [
        "@com_github_dorfire_go_analyzers//src/onlyany",
        "@com_github_dorfire_go_analyzers//src/visibilityorder",
        # ...
    ],
)

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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