gocapture

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 8 Imported by: 0

README

gocapture

gocapture is a tool for detecting maps and slices that do not have sufficient length or capacity.

Instruction

go get github.com/sivchari/gocapture

Usage

package main

func main() {
	// sufficient capacity
	c := make([]int, 0, 5)
	print(c)

	// zero capacity
	a := make([]int, 0)
	print(a)
}
fish
go vet -vettool=(which gocapture) ./...
bash
go vet -vettool=`which gocapture` ./...
output
./main.go:9:19: captured the not capacity

CI

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

Documentation

Index

Constants

This section is empty.

Variables

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

Analyzer is ...

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