typeswitch

package module
v0.0.0-...-0c79224 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 6 Imported by: 1

README

typeswitch

godoc.org

typeswitch finds a type which implement an interfaces which are used in type-switch but the type does not appear in any cases of the type-switch.

package main

type I interface{ F() }
type A struct{I} // implements I
type B struct{I} // implements I

func main() {
	var i I = A{}
	switch i.(type) {
	case A:
	}
}
$go vet -vettool=`which typeswitch` main.go
./main.go:9:2: type B does not appear in any cases

Documentation

Index

Constants

View Source
const Doc = "" /* 144-byte string literal not displayed */

Variables

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

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