Analyzer: zapvet is static analysis tool for zap

Related tags

zapvet
Overview

zapvet

pkg.go.dev

zapvet is static analysis tool for zap.

  • fieldtype: fieldtype finds confliction type of field

Install

You can get zapvet by go install command (Go 1.16 and higher).

$ go install github.com/gostaticanalysis/[email protected]

How to use

zapvet run with go vet as below when Go is 1.12 and higher.

$ go vet -vettool=$(which zapvet) ./...

Analyzers

fieldtype

fieldtype finds confliction type of field.

package a

import "go.uber.org/zap"

func f() {
	zap.String("id", "100")
	zap.Int("id", 100)       // want `"id" conflict type Int vs String`
	zap.Any("id", "100")     // OK - ignore
	zap.Reflect("id", "100") // OK - ignore
	zap.String("xxx", "100") // OK
}

Analyze with golang.org/x/tools/go/analysis

You can get analyzers of zapvet from zapvet.Analyzers. And you can use them with unitchecker.

Issues
Releases(v0.3.0)
Owner
GoStaticAnalysis
Static Analysis Tools for Go
GoStaticAnalysis
This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Google 80 Jul 23, 2021
[mirror] Performance measurement, storage, and analysis.

Go performance measurement, storage, and analysis tools This subrepository holds the source for various packages and tools related to performance meas

Go 272 Jul 20, 2021
A static code analyzer for annotated TODO comments

todocheck todocheck is a static code analyzer for annotated TODO comments. It let's you create actionable TODOs by annotating them with issues from an

Preslav Mihaylov 332 Jul 21, 2021
๐Ÿ”ฅ ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

revive Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. Revive provides a framework for developme

Minko Gechev 2.9k Jul 24, 2021
structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.

structslop Package structslop defines an Analyzer that checks struct can be re-arranged fields to get optimal struct size.

orijtech 334 Jul 14, 2021
๐Ÿถ Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

reviewdog 3.5k Jul 21, 2021
Staticcheck - The advanced Go linter

The advanced Go linter Staticcheck is a state of the art linter for the Go programming language. Using static analysis, it finds bugs and performance

Dominik Honnef 4k Jul 24, 2021
A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

360 Enterprise Security Group, Endpoint Security, inc. 2.9k Jul 16, 2021
๐Ÿ”’๐ŸŒ Security scanner for your Terraform code

????tfsec uses static analysis of your terraform templates to spot potential security issues.

tfsec 3k Jul 19, 2021
Find in Go repeated strings that could be replaced by a constant

goconst Find repeated strings that could be replaced by a constant. Motivation There are obvious benefits to using constants instead of repeating stri

Jonathan Gautheron 205 Jul 18, 2021
Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go

Sloc Cloc and Code (scc) A tool similar to cloc, sloccount and tokei. For counting physical the lines of code, blank lines, comment lines, and physica

Ben Boyter 2.6k Jul 17, 2021
Tool to populate your code with traceable and secure error codes

Essential part of any project, especially customer facing is proper and secure error handling. When error happens and customer reports it, it would be nice to know the context of the error and where it exactly occured.

vs 51 Apr 4, 2021
The most opinionated Go source code linter for code audit.

go-critic Highly extensible Go source code linter providing checks currently missing from other linters. There is never too much static code analysis.

null 961 Jul 23, 2021