github.com/haraldrudell/parl@v0.4.176/iters/next-action.go (about)

     1  /*
     2  © 2022–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package iters
     7  
     8  const (
     9  	// IsSame indicates to Delegate.Next that
    10  	// this is a Same-type incovation
    11  	IsSame NextAction = false
    12  	// IsNext indicates to Delegate.Next that
    13  	// this is a Next-type incovation
    14  	IsNext NextAction = true
    15  )
    16  
    17  // NextAction is a unique named type that indicates whether
    18  // the next or the same value again is sought by Delegate.Next
    19  //   - IsSame IsNext
    20  type NextAction bool
    21  
    22  func (a NextAction) String() (s string) { return nextActionSet[a] }
    23  
    24  // nextActionSet is the set helper for NextAction
    25  var nextActionSet = map[NextAction]string{
    26  	IsSame: "IsSame",
    27  	IsNext: "IsNext",
    28  }