forked from deblan/database-anonymizer
add IsInterger property in Data struct
add tests
This commit is contained in:
parent
60cbaf1530
commit
83682511b3
|
@ -16,22 +16,26 @@ type Data struct {
|
|||
IsVirtual bool
|
||||
IsPrimaryKey bool
|
||||
IsUpdated bool
|
||||
IsInteger bool
|
||||
}
|
||||
|
||||
func (d *Data) FromByte(v []byte) *Data {
|
||||
d.Value = string(v)
|
||||
d.IsInteger = false
|
||||
|
||||
return d
|
||||
}
|
||||
|
||||
func (d *Data) FromInt64(v int64) *Data {
|
||||
d.Value = strconv.FormatInt(v, 10)
|
||||
d.IsInteger = true
|
||||
|
||||
return d
|
||||
}
|
||||
|
||||
func (d *Data) FromString(v string) *Data {
|
||||
d.Value = v
|
||||
d.IsInteger = false
|
||||
|
||||
return d
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue