gonoouterval

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 1 Imported by: 0

README

gonoouterval

※ Linterの実装自体は motemenさんのgo-statictoolsをほぼそのまま利用しています。

golangci-lint v2

ビルド

custom golangci-lint binary をビルドする必要があります。

まず、.custom-gcl.ymlファイルを以下の内容で作成します。

version: v2.12.2
plugins:
  - module: github.com/walnuts1018/gonoouterval
    import: "github.com/walnuts1018/gonoouterval"
    version: latest

その後、golangci-lint customを使って、plugin入りのgolangci-lintをビルドします。

golangci-lint custom --name custom-gcl
利用

.golangci.ymlgonoouterval を有効化します。 settings.type には、検査対象の型を path/to/pkg.Type 形式で指定します。

version: "2"
linters:
  default: none
  enable:
    - gonoouterval
  settings:
    custom:
      gonoouterval:
        type: module
        description: Check for outer scoped values when same-typed inner values exist.
        settings:
          types:
            - context.Context
            - path/to/pkg.Type

custom golangci-lint を実行します。

./custom-gcl run ./...

単体 analyzer として使う

golangci-lint を経由せず、単体 command としても実行できます。

go build ./cmd/gonoouterval
gonoouterval -types context.Context,path/to/pkg.Type ./...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gonoouterval command
Package noouterval finds uses of values from the outer scope, despite values of same type is defined in the inner scope.
Package noouterval finds uses of values from the outer scope, despite values of same type is defined in the inner scope.

Jump to

Keyboard shortcuts

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