Skip to content

Commit fc103b8

Browse files
committed
upd: added godoc
1 parent 0077c56 commit fc103b8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

cmd/staticlint/analyzers/no_exit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import (
66
"golang.org/x/tools/go/analysis"
77
)
88

9+
// Analyzer определяет анализатор, который проверяет отсутствие вызовов os.Exit в функции main пакета main.
910
var Analyzer = &analysis.Analyzer{
1011
Name: "no_exit",
1112
Doc: "Запрещает использование os.Exit в main функции пакета main",
1213
Run: run,
1314
}
1415

16+
// run выполняет анализ AST файлов в пакете и проверяет, содержат ли они
17+
// запрещенный вызов os.Exit в функции main.
1518
func run(pass *analysis.Pass) (interface{}, error) {
1619
for _, file := range pass.Files {
1720
if pass.Pkg.Name() != "main" {

staticlint

-16.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)