sleuth

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 6 Imported by: 0

README

sleuth

test_and_lint

sleuth detects when an append is used on a slice with an initial size.

Instruction

go install github.com/sivchari/sleuth/cmd/sleuth

Usage

package main

func main() {
	test := []int{1, 2, 3, 4, 5}
	a := make([]int, 5)
	for _, tt := range test {
		a = append(a, tt)
	}
}
fish
$ go vet -vettool=(which sleuth) ./...
main.go:7:3: sleuth found you are trying append to a slice with an initial size
bash
$ go vet -vettool=`which sleuth` ./...
main.go:7:3: sleuth found you are trying append to a slice with an initial size

CI

CircleCI
- run:
    name: Install sleuth
    command: go get github.com/sivchari/sleuth

- run:
    name: Run sleuth
    command: go vet -vettool=`which sleuth` ./...
GitHub Actions
- name: Install sleuth
    run: go get github.com/sivchari/sleuth

- name: Run sleuth
    run: go vet -vettool=`which sleuth` ./...

Documentation

Index

Constants

This section is empty.

Variables

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

Analyzer is the sleuth 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