File: super.go

package info (click to toggle)
golang-github-gobwas-glob 0.2.3%2Bgit20181002.e7a84e9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 364 kB
  • sloc: sh: 20; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (4)
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 match

import (
	"fmt"
)

type Super struct{}

func NewSuper() Super {
	return Super{}
}

func (self Super) Match(s string) bool {
	return true
}

func (self Super) Len() int {
	return lenNo
}

func (self Super) Index(s string) (int, []int) {
	segments := acquireSegments(len(s) + 1)
	for i := range s {
		segments = append(segments, i)
	}
	segments = append(segments, len(s))

	return 0, segments
}

func (self Super) String() string {
	return fmt.Sprintf("<super>")
}