File: constraint_option.go

package info (click to toggle)
golang-github-aquasecurity-go-version 0.0~git20210121.637058c-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: makefile: 5
file content (22 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package semver

type conf struct {
	zeroPadding       bool
	includePreRelease bool
}

type ConstraintOption interface {
	apply(*conf)
}

type WithZeroPadding bool

func (o WithZeroPadding) apply(c *conf) {
	c.zeroPadding = bool(o)
}

type WithPreRelease bool

func (o WithPreRelease) apply(c *conf) {
	c.includePreRelease = bool(o)
}