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 .test
.go

View File

@ -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 .

View File

@ -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.

View File

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

View File

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