Skip to content

Build tags not propagating correctly #1412

@matthewhartstonge

Description

@matthewhartstonge

Howdy! 🤠

Summary

SSA panics are occurring when performing static analysis due to references not being included when build tags are involved.

Description

I've been seeing static analysis panics occurring when references can't be found that should have been included by build tags.

See failing gosec report log here: https://github.com/matthewhartstonge/exp-buildtag/blob/main/gosec-log.txt

Prior Art

I noticed that a couple of issues and PRs in the past have attempted to fix this issue:

Workaround

You can currently set the GOFLAGS envvar with your expected build tags, gosec will then run as expected.

export GOFLAGS='-tags=tag'

Reproducible

Refer: https://github.com/matthewhartstonge/exp-buildtag

Fix

See: #1413

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