Skip to content

Commit 989b042

Browse files
author
Sridhar Ratnakumar
committed
remove logyard references and update README
also fix local gopath
1 parent 1a694c8 commit 989b042

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.test
2+
.go
3+

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
default: test
22

3+
setup:
4+
GOPATH=`pwd`/.go go get -d -v .
5+
GOPATH=`pwd`/.go go test -v -i
6+
rm -f `pwd`/.go/src/tail
7+
ln -sf `pwd` `pwd`/.go/src/tail
8+
39
test: *.go
4-
GOPATH=~/as/logyard go test -v
10+
GOPATH=`pwd`/.go go test -v
511

612
fmt:
713
go fmt .

README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,26 @@
33
A Go package striving to emulate the BSD `tail` program.
44

55
```Go
6-
t := tail.TailFile("/var/log/nginx.log", 1000, true, true)
6+
t := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true})
77
for line := range t.Lines {
88
fmt.Println(line.Text)
99
}
1010
```
1111

12+
## Building
13+
14+
To build and test the package,
15+
16+
make setup
17+
make test
18+
19+
To build the command-line program `gotail`,
20+
21+
cd cmd/gotail
22+
make
23+
./gotail -h
24+
1225
## TODO
1326

14-
* tests
15-
* command line program (`tail -f ...`)
16-
* refactor: use Config? `NewTail(tail.Config{Filename: "", Follow: tail.FOLLOW_NAME})`
17-
* refactor: get rid of 'end' flag; allow `-n <number>` with `-n -1`
18-
for end.
27+
* Support arbitrary values for `Location`
28+

cmd/gotail/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
default: gotail
22

33
gotail: *.go ../../*.go
4-
GOPATH=~/as/logyard go build
4+
GOPATH=`pwd`/../../.go go build

cmd/gotail/gotail.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"fmt"
5-
"logyard/tail"
5+
"tail"
66
"flag"
77
"os"
88
)

0 commit comments

Comments
 (0)