mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-01 06:51:18 +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
|
|
@ -33,10 +33,18 @@ func (o Release) GetID() int64 {
|
|||
return o.ID
|
||||
}
|
||||
|
||||
func (o Release) GetIDString() string {
|
||||
return fmt.Sprintf("%d", o.GetID())
|
||||
}
|
||||
|
||||
func (o *Release) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
func (o *Release) SetIDString(id string) {
|
||||
o.SetID(util.ParseInt(id))
|
||||
}
|
||||
|
||||
func (o *Release) IsNil() bool {
|
||||
return o.ID == 0
|
||||
}
|
||||
|
|
@ -45,6 +53,10 @@ func (o *Release) Equals(other *Release) bool {
|
|||
return o.ID == other.ID
|
||||
}
|
||||
|
||||
func (o *Release) ToFormatInterface() format.Interface {
|
||||
return o.ToFormat()
|
||||
}
|
||||
|
||||
func (o *Release) ToFormat() *format.Release {
|
||||
return &format.Release{
|
||||
Common: format.NewCommon(o.ID),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue