Skip to content

Format options for results on stdout not working #644

@wongherlung

Description

@wongherlung

Summary

The -fmt flag does not work when the results are printed to stdout by default.

Seems like we can only get the format we want on stdout only when we run gosec -out output.json -stdout -verbose json ./.... I suspect that a8b633f changed the behavior.

Steps to reproduce the behavior

Run gosec -fmt json ./....

gosec version

v2.8.0

Go version (output of 'go version')

go version go1.14.1 linux/amd64

Operating system / Environment

Ubuntu 20.04

Expected behavior

A JSON object will be printed out on stdout.

Actual behavior

The text output is printed to stdout.

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