1 package match 2 3 import ( 4 "fmt" 5 ) 6 7 type Nothing struct{} 8 9 func NewNothing() Nothing { 10 return Nothing{} 11 } 12 13 func (self Nothing) Match(s string) bool { 14 return len(s) == 0 15 } 16 17 func (self Nothing) Index(s string) (int, []int) { 18 return 0, segments0 19 } 20 21 func (self Nothing) Len() int { 22 return lenZero 23 } 24 25 func (self Nothing) String() string { 26 return fmt.Sprintf("<nothing>") 27 } 28