From 02998a74ae0bf463c79e87fac1df66174f4e7970 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Mon, 27 Aug 2018 12:00:36 +0300 Subject: [PATCH] add pedantic flag Updates #6 --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 25973ca..684f969 100644 --- a/main.go +++ b/main.go @@ -14,11 +14,14 @@ import ( func main() { log.SetFlags(0) + var ctxt context + + flag.BoolVar(&ctxt.Pedantic, "pedantic", false, + `makes several diagnostics more pedantic and comprehensive`) flag.Parse() filenames := targetsToFilenames(flag.Args()) - var ctxt context ctxt.SetupOpsTable() if err := visitFiles(&ctxt, filenames, ctxt.InferConventions); err != nil { log.Fatalf("infer conventions: %v", err) @@ -37,6 +40,8 @@ type context struct { ops []*operation fset *token.FileSet + Pedantic bool + Warnings []warning }