remove logyard references and update README
also fix local gopath
This commit is contained in:
parent
1a694c85a6
commit
989b0425dc
|
@ -1 +1,3 @@
|
||||||
.test
|
.test
|
||||||
|
.go
|
||||||
|
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -1,7 +1,13 @@
|
||||||
default: test
|
default: test
|
||||||
|
|
||||||
|
setup:
|
||||||
|
GOPATH=`pwd`/.go go get -d -v .
|
||||||
|
GOPATH=`pwd`/.go go test -v -i
|
||||||
|
rm -f `pwd`/.go/src/tail
|
||||||
|
ln -sf `pwd` `pwd`/.go/src/tail
|
||||||
|
|
||||||
test: *.go
|
test: *.go
|
||||||
GOPATH=~/as/logyard go test -v
|
GOPATH=`pwd`/.go go test -v
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go fmt .
|
go fmt .
|
||||||
|
|
22
README.md
22
README.md
|
@ -3,16 +3,26 @@
|
||||||
A Go package striving to emulate the BSD `tail` program.
|
A Go package striving to emulate the BSD `tail` program.
|
||||||
|
|
||||||
```Go
|
```Go
|
||||||
t := tail.TailFile("/var/log/nginx.log", 1000, true, true)
|
t := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true})
|
||||||
for line := range t.Lines {
|
for line := range t.Lines {
|
||||||
fmt.Println(line.Text)
|
fmt.Println(line.Text)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To build and test the package,
|
||||||
|
|
||||||
|
make setup
|
||||||
|
make test
|
||||||
|
|
||||||
|
To build the command-line program `gotail`,
|
||||||
|
|
||||||
|
cd cmd/gotail
|
||||||
|
make
|
||||||
|
./gotail -h
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* tests
|
* Support arbitrary values for `Location`
|
||||||
* command line program (`tail -f ...`)
|
|
||||||
* refactor: use Config? `NewTail(tail.Config{Filename: "", Follow: tail.FOLLOW_NAME})`
|
|
||||||
* refactor: get rid of 'end' flag; allow `-n <number>` with `-n -1`
|
|
||||||
for end.
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
default: gotail
|
default: gotail
|
||||||
|
|
||||||
gotail: *.go ../../*.go
|
gotail: *.go ../../*.go
|
||||||
GOPATH=~/as/logyard go build
|
GOPATH=`pwd`/../../.go go build
|
||||||
|
|
|
@ -2,7 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"logyard/tail"
|
"tail"
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue