mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-02 15:31:03 +00:00
[F3] upgrade to gof3 50a6e740ac04
Add new methods GetIDString() & SetIDString() & ToFormatInterface() Change the prototype of the fixture function
This commit is contained in:
parent
4446e9f98a
commit
d7b263ff8b
16 changed files with 154 additions and 4 deletions
|
|
@ -31,6 +31,10 @@ func (o Milestone) GetID() int64 {
|
|||
return o.ID
|
||||
}
|
||||
|
||||
func (o Milestone) GetIDString() string {
|
||||
return fmt.Sprintf("%d", o.GetID())
|
||||
}
|
||||
|
||||
func (o Milestone) GetName() string {
|
||||
return o.Name
|
||||
}
|
||||
|
|
@ -39,6 +43,10 @@ func (o *Milestone) SetID(id int64) {
|
|||
o.ID = id
|
||||
}
|
||||
|
||||
func (o *Milestone) SetIDString(id string) {
|
||||
o.SetID(util.ParseInt(id))
|
||||
}
|
||||
|
||||
func (o *Milestone) IsNil() bool {
|
||||
return o.ID == 0
|
||||
}
|
||||
|
|
@ -47,6 +55,10 @@ func (o *Milestone) Equals(other *Milestone) bool {
|
|||
return o.Name == other.Name
|
||||
}
|
||||
|
||||
func (o *Milestone) ToFormatInterface() format.Interface {
|
||||
return o.ToFormat()
|
||||
}
|
||||
|
||||
func (o *Milestone) ToFormat() *format.Milestone {
|
||||
milestone := &format.Milestone{
|
||||
Common: format.NewCommon(o.ID),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue