You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/vendor/github.com/antihax/optional/int64.go

37 lines
473 B

package optional
type Int64 struct {
isSet bool
value int64
}
func NewInt64(value int64) Int64 {
return Int64{
true,
value,
}
}
// EmptyInt64 returns a new Int64 that does not have a value set.
func EmptyInt64() Int64 {
return Int64{
false,
0,
}
}
func (i Int64) IsSet() bool {
return i.isSet
}
func (i Int64) Value() int64 {
return i.value
}
func (i Int64) Default(defaultValue int64) int64 {
if i.isSet {
return i.value
}
return defaultValue
}