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