diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5dede97 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "go.formatFlags": [ + "-s" + ] +} diff --git a/mutator/branch/mutatecase.go b/mutator/branch/mutatecase.go index ded96c5..9184aca 100644 --- a/mutator/branch/mutatecase.go +++ b/mutator/branch/mutatecase.go @@ -22,7 +22,7 @@ func MutatorCase(pkg *types.Package, info *types.Info, node ast.Node) []mutator. old := n.Body return []mutator.Mutation{ - mutator.Mutation{ + { Change: func() { n.Body = []ast.Stmt{ astutil.CreateNoopOfStatements(pkg, info, n.Body), diff --git a/mutator/branch/mutateelse.go b/mutator/branch/mutateelse.go index d934e8a..8832719 100644 --- a/mutator/branch/mutateelse.go +++ b/mutator/branch/mutateelse.go @@ -27,7 +27,7 @@ func MutatorElse(pkg *types.Package, info *types.Info, node ast.Node) []mutator. old := n.Else return []mutator.Mutation{ - mutator.Mutation{ + { Change: func() { n.Else = astutil.CreateNoopOfStatement(pkg, info, old) }, diff --git a/mutator/branch/mutateif.go b/mutator/branch/mutateif.go index 91c46a5..2513135 100644 --- a/mutator/branch/mutateif.go +++ b/mutator/branch/mutateif.go @@ -22,7 +22,7 @@ func MutatorIf(pkg *types.Package, info *types.Info, node ast.Node) []mutator.Mu old := n.Body.List return []mutator.Mutation{ - mutator.Mutation{ + { Change: func() { n.Body.List = []ast.Stmt{ astutil.CreateNoopOfStatement(pkg, info, n.Body), diff --git a/mutator/expression/remove.go b/mutator/expression/remove.go index f18a314..34f812e 100644 --- a/mutator/expression/remove.go +++ b/mutator/expression/remove.go @@ -35,7 +35,7 @@ func MutatorRemoveTerm(pkg *types.Package, info *types.Info, node ast.Node) []mu y := n.Y return []mutator.Mutation{ - mutator.Mutation{ + { Change: func() { n.X = r }, @@ -43,7 +43,7 @@ func MutatorRemoveTerm(pkg *types.Package, info *types.Info, node ast.Node) []mu n.X = x }, }, - mutator.Mutation{ + { Change: func() { n.Y = r }, diff --git a/scripts/lint.sh b/scripts/lint.sh index 2577151..e8af6d8 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -4,7 +4,7 @@ if [ -z ${PKG+x} ]; then echo "PKG is not set"; exit 1; fi if [ -z ${ROOT_DIR+x} ]; then echo "ROOT_DIR is not set"; exit 1; fi echo "gofmt:" -OUT=$(gofmt -l $ROOT_DIR 2>&1 | grep --invert-match -E "(/example)") +OUT=$(gofmt -l -s $ROOT_DIR 2>&1 | grep --invert-match -E "(/example)") if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi echo "errcheck:"