diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/line/line.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/line/line.go b/internal/line/line.go new file mode 100644 index 0000000..02dbbcc --- /dev/null +++ b/internal/line/line.go @@ -0,0 +1,22 @@ +package line + +import "sync" + +type Line struct { + sync.Mutex + num int64 +} + +func (l *Line) Inc() { + l.Lock() + defer l.Unlock() + + l.num++ +} + +func (l *Line) Num() int64 { + l.Lock() + defer l.Unlock() + + return l.num +} |