Skip to content

Fix various linting issues, some refactoring and cleaning up - #39

Open
Sebastiaan van Stijn (thaJeztah) wants to merge 5 commits into
Azure:masterfrom
thaJeztah:refactor_and_linting_step1
Open

Fix various linting issues, some refactoring and cleaning up#39
Sebastiaan van Stijn (thaJeztah) wants to merge 5 commits into
Azure:masterfrom
thaJeztah:refactor_and_linting_step1

Conversation

@thaJeztah

Copy link
Copy Markdown
Contributor

@thaJeztah

Copy link
Copy Markdown
Contributor Author

/cc Olivier Mengué (@dolmen) ptal

Current versions of go refused to run tests;

    go vet .
    parser.go:139:37: logf format %s arg newState.Name is a func value, not called

    go test
    # github.com/Azure/go-ansiterm
    # [github.com/Azure/go-ansiterm]
    ./parser.go:139:37: logf format %s arg newState.Name is a func value, not called
    FAIL	github.com/Azure/go-ansiterm [build failed]

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Fix linting, remove the unused error-return from parseParams, and inline
the parseCmd utility.

    parser.go:116:10: ST1005: error strings should not end with punctuation or newlines (staticcheck)
            return errors.New("New state of 'nil' is invalid.")
                   ^
    parser_action_helpers.go:8:28: S1019: should use make([]byte, 0) instead (staticcheck)
        paramBuff := make([]byte, 0, 0)
                                  ^
    parser_action_helpers.go:17:30: S1019: should use make([]byte, 0) instead (staticcheck)
                    paramBuff = make([]byte, 0, 0)
                                             ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants