github.com/leanovate/gopter@v0.2.9/gen/const.go (about)

     1  package gen
     2  
     3  import "github.com/leanovate/gopter"
     4  
     5  // Const creates a generator for a constant value
     6  // Not the most exciting generator, but can be helpful from time to time
     7  func Const(value interface{}) gopter.Gen {
     8  	return func(*gopter.GenParameters) *gopter.GenResult {
     9  		return gopter.NewGenResult(value, gopter.NoShrinker)
    10  	}
    11  }