func (s *SQLVet) Vet() {
	queries, err := vet.CheckDir(
		vet.VetContext{
			Schema: s.Schema,
		},
		s.ProjectRoot,
		s.Cfg.SqlFuncMatchers,
	)
	if err != nil {
		cli.Exit(err)
	}
	for _, q := range queries {
		atomic.AddInt32(&s.QueryCnt, 1)
		if q.Err == nil {
			if cli.Verbose {
				cli.Show("query detected at %s", q.Position)
			}
			continue
		}
		if flagErrFormat {
			relFilePath, err := filepath.Rel(s.ProjectRoot, q.Position.Filename)
			if err != nil {
				relFilePath = s.ProjectRoot
			}
			cli.Show(
				"%s:%d:%d: %v",
				relFilePath, q.Position.Line, q.Position.Column, q.Err)
		} else {
			cli.Bold("%s @ %s", q.Called, q.Position)
			if q.Query != "" {
				cli.Show("\t%s\n", q.Query)
			}
			s.reportError("\tERROR: %v", q.Err)
			switch q.Err {
			case vet.ErrQueryArgUnsafe:
				cli.Show("\tHINT: if this is a false positive, annotate with `// sqlvet: ignore` comment")
			}
			cli.Show("")
		}
	}
}
Vet performs static analysis
package main
import (
	"fmt"
	"os"
	"path/filepath"
	"sync/atomic"
	log "github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
	"github.com/houqp/sqlvet/pkg/cli"
	"github.com/houqp/sqlvet/pkg/config"
	"github.com/houqp/sqlvet/pkg/schema"
	"github.com/houqp/sqlvet/pkg/vet"
)
const version = "1.1.1"
var (
	gitCommit     = "?"
	flagErrFormat = false
)
type SQLVet struct {
	QueryCnt int32
	ErrCnt   int32
	Cfg         config.Config
	ProjectRoot string
	Schema      *schema.Db
}
func (s *SQLVet) reportError(format string, a ...interface{}) {
	cli.Error(format, a...)
	atomic.AddInt32(&s.ErrCnt, 1)
}