summaryrefslogtreecommitdiff
path: root/internal/lcontext/lcontext.go
blob: 89cb7c3be1923c5daaa061e4182d352c62fb3f41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}