Skip to content

Syntax errors are not reported #12

Closed
@alecthomas

Description

@alecthomas

eg.

[aat@cavern:~/Projects/kong]golangci-lint run --fast
Congrats! No issues were found.
[aat@cavern:~/Projects/kong]go build .
# github.com/alecthomas/kong
../../.go/src/github.com/alecthomas/kong/build.go:67:5: syntax error: unexpected ft at end of statement
../../.go/src/github.com/alecthomas/kong/build.go:69:5: syntax error: unexpected else at end of statement
../../.go/src/github.com/alecthomas/kong/build.go:72:2: syntax error: non-declaration statement outside function body
[aat@cavern:~/Projects/kong]git diff
diff --git a/build.go b/build.go
index 2eabbf9..7fa50cd 100644
--- a/build.go
+++ b/build.go
@@ -64,7 +64,7 @@ func buildNode(v reflect.Value, seenFlags map[string]bool) *Node {
                tag := parseTag(fv, ft.Tag.Get("kong"))

                // Nested structs are either commands or args.
-               if ft.Type.Kind() == reflect.Struct && (tag.Cmd || tag.Arg) {
+               i ft.Type.Kind() == reflect.Struct && (tag.Cmd || tag.Arg) {
                        buildChild(node, v, ft, fv, tag, name, seenFlags)
                } else {
                        buildField(node, v, ft, fv, tag, name, seenFlags)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions