hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.72k stars 505 forks source link

Feature/line seeker #108

Open StoicPerlman opened 7 years ago

StoicPerlman commented 7 years ago

This is a a rough draft for issue #83 seek by line. Any feedback will be in PR update.

See https://github.com/StoicPerlman/fls to get info on how line seeking works

Tests pass locally in docker build but not in travis. Still working on this. Any advice would be helpful as I am pretty new to travis and go.

StoicPerlman commented 6 years ago

@Nino-K This is passing now for 1.7+. This is because my package is using io.SeekStart, which replaced os.SEEK_SET in 1.7. I can update my package to handle this if its important to you. But maybe tail could drop those while adding 1.9? I have another PR that removed os.SEEK from tail and drops 1.5 and 1.6 from travis.

StoicPerlman commented 6 years ago

Added line seeker to gotail cmd. Switched -n from using position in file to lines.

nishantroy commented 6 years ago

@StoicPerlman any updates here?

StoicPerlman commented 6 years ago

@nishantroy This is working just fine for me. No word from the project maintainers.

If you check out the Travis build you can see this PR its passing for Go 1.7+. I have another PR on this repo to remove some deprecated go features and drop support for under 1.7.

I added this functionality by creating a library which is also passing all tests on master branch for 1.7+ If you are interested in looking it over you can find it here https://travis-ci.org/StoicPerlman/fls.

If you want this functionality now just used my forked version until this gets merged. https://github.com/StoicPerlman/tail.