Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open absolute paths as files, limited Windows support #1159

Merged
merged 5 commits into from Sep 12, 2022

Commits on Sep 12, 2022

  1. Prefactor sink factory into sinkRegistry type

    This makes it easier to test sinkRegistry functionality that registers
    temporary sinks, and in future, stubbing of the os.OpenFile call.
    prashantv committed Sep 12, 2022
    Copy the full SHA
    faa89d1 View commit details
    Browse the repository at this point in the history
  2. Stub os.OpenFile in SinkRegistry

    This avoids a dependency on the underlying filesystem, which avoids
    unnecessarily trying to open files when we just want to ensure that
    paths are opened using the file sink.
    prashantv committed Sep 12, 2022
    Copy the full SHA
    7458b7f View commit details
    Browse the repository at this point in the history
  3. Support windows paths by checking filepath.IsAbs

    Windows absolute paths such as `c:\log.json` parse as URLs with
    the scheme set. The sink registry currently expects file paths
    to either have a `file` scheme, or no scheme. Rather than trying to
    special-case drives in schemes, and reassemble paths, simplify by
    checking for `filepath.IsAbs` before parsing the path as a URL.
    
    Since `filepath.IsAbs` is OS-specific, windows paths will not be
    treated as absolute paths on other systems, and will still work
    using any registered sink factories.
    prashantv committed Sep 12, 2022
    Copy the full SHA
    12d8e32 View commit details
    Browse the repository at this point in the history
  4. Update copyright

    prashantv committed Sep 12, 2022
    Copy the full SHA
    67069df View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    15c26e5 View commit details
    Browse the repository at this point in the history