diff options
Diffstat (limited to 'internal/lcontext')
| -rw-r--r-- | internal/lcontext/lcontext.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/lcontext/lcontext.go b/internal/lcontext/lcontext.go new file mode 100644 index 0000000..89cb7c3 --- /dev/null +++ b/internal/lcontext/lcontext.go @@ -0,0 +1,22 @@ +package lcontext + +// LContext stands for line context and is here to help filtering out only specific lines. +type LContext struct { + AfterContext int + BeforeContext int + MaxCount int +} + +// Has returns true if it has any parameter set. +func (c LContext) Has() bool { + if c.AfterContext > 0 { + return true + } + if c.BeforeContext > 0 { + return true + } + if c.MaxCount > 0 { + return true + } + return false +} |
