File: any.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 (33 lines) | stat: -rw-r--r-- 422 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
23
24
25
26
27
28
29
30
31
32
33
package part

import (
	"golang.org/x/xerrors"
)

type Any bool

func NewAny(s string) (Any, error) {
	if s == "*" || s == "x" || s == "X" {
		return true, nil
	}
	return true, xerrors.New("not wildcard")
}

func (s Any) Compare(other Part) int {
	if s {
		return 0
	}
	return -1
}

func (s Any) IsNull() bool {
	return false
}

func (s Any) IsAny() bool {
	return bool(s)
}

func (s Any) IsEmpty() bool {
	return false
}