remove logyard references and update README

also fix local gopath
This commit is contained in:
Sridhar Ratnakumar 2012-10-17 11:56:54 -07:00
parent 1a694c85a6
commit 989b0425dc
5 changed files with 27 additions and 9 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.test
.go

View File

@ -1,7 +1,13 @@
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
GOPATH=~/as/logyard go test -v
GOPATH=`pwd`/.go go test -v
fmt:
go fmt .

View File

@ -3,16 +3,26 @@
A Go package striving to emulate the BSD `tail` program.
```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 {
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
* tests
* 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.
* Support arbitrary values for `Location`

View File

@ -1,4 +1,4 @@
default: gotail
gotail: *.go ../../*.go
GOPATH=~/as/logyard go build
GOPATH=`pwd`/../../.go go build

View File

@ -2,7 +2,7 @@ package main
import (
"fmt"
"logyard/tail"
"tail"
"flag"
"os"
)