19. is a tool that analyzes source code to ﬂag
programming errors, bugs, stylistic errors,
and suspicious constructs
What is a linter?
20. Lexer and Parser
● Lexer: converts the statements in code into various
categories of like keywords, constants, variable in a
sentence and produce token
● Parser: takes the tokens produced by the lexer and tries
to determine whether these statements are semantically
● The code used to express a program is
written using the data structures of
● The Lisp family languages (Common
Lisp, Scheme, Clojure, etc)
● Code is Data, Data is Code
29. ● gofmt - Must have for every project
● goimports - Additionally to gofmt, checks unused imports
● unindent - Report code that is unnecessarily indented
32. ● abcgo - ABC metrics for Go source code.
● gocyclo - Computes and checks the cyclomatic
complexity of functions.
● splint - It finds any functions that are too long or have too
many parameters or results.
35. ● GoLint - Golint is a linter for Go source code
● revive - Drop-in replacement of golint
● go-namecheck - helps you to maintain variable/field
naming conventions inside your project
● lll - Line length linter, used to enforce line length in files
Style and Patterns Checking
● Allows to enable, disable, conﬁgure
rules using a TOML ﬁle
● Allows disabling a speciﬁc rule or
the entire linter for a ﬁle or a range
● Provides multiple formatters which
let us customize the output
43. ● govet - checks correctness: a vet check identifies real or
potential bugs that could cause incorrect compilation or
● badtime - Badtime is a Golang linter that detects
inappropriate usage of the time.Time struct.
● safesql - Static analysis tool for Golang that protects
against SQL injections.
● Code Complete: A Practical Handbook of Software Construction
● Effective Go
● golang/lint Repository
● SourceLevel: Team Metrics and Automated Code Review
● How do you define “Good Code”?
● Awesome Go Linters
● scanner Package
● Basic AST Manipulation in Go
● Internal vs External Software Quality