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

     1  package gen
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/leanovate/gopter"
     7  )
     8  
     9  // Fail is a generator that always fails to generate a value
    10  // Useful as fallback
    11  func Fail(resultType reflect.Type) gopter.Gen {
    12  	return func(*gopter.GenParameters) *gopter.GenResult {
    13  		return gopter.NewEmptyResult(resultType)
    14  	}
    15  }