bazel-contrib / bazel-contrib/rules_go
Support `Seek()` in `fs.FS` runfiles implementation
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
Currently the `fs.FS.Open()` call returns an `fs.File` interface which does provide the `.Seek()` method. Return an interface inheriting from both `fs.File` _and_ `io.Seeker` and provide the `.Seek()` method in the `renamedFileInfo` struct in [`fs.go`](https://github.com/bazel-contrib/rules_go/blob/master/go/runfiles/fs.go).
Note: This approach is also used by the core `http` package, see golang/go#66877.
Example: https://gotipplay.golang.org/p/o9ABZj7Sfx6
Contributor guide
Research direction
Start in fs.go at the fs.FS.Open implementation and the renamedFileInfo struct. Compare the approach referenced in the core http package and inspect how the returned fs.File is used. Done means the returned interface includes io.Seeker and renamedFileInfo provides Seek behavior for runfiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100