Skip to content

go_test: data not available in init() #1918

@robfig

Description

@robfig

In rules_go v0.16.5, go_test targets are not able to access data files in init() functions. I presume this is because whatever changes the working directory does not run until afterwards. However questionable reading files in init() is as a design choice, it does work with the Go command line tool, so seems like it should be supported by rules_go as well.

Here's a reproducer
https://github.com/robfig/go_test_data

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions