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
|
|
@ -32,10 +32,18 @@ func (o Asset) GetID() int64 {
|
|||
return o.ID
|
||||
}
|
||||
|
||||
func (o Asset) GetIDString() string {
|
||||
return fmt.Sprintf("%d", o.GetID())
|
||||
}
|
||||
|
||||
func (o *Asset) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
func (o *Asset) SetIDString(id string) {
|
||||
o.SetID(util.ParseInt(id))
|
||||
}
|
||||
|
||||
func (o *Asset) IsNil() bool {
|
||||
return o.ID == 0
|
||||
}
|
||||
|
|
@ -44,6 +52,10 @@ func (o *Asset) Equals(other *Asset) bool {
|
|||
return o.Name == other.Name
|
||||
}
|
||||
|
||||
func (o *Asset) ToFormatInterface() format.Interface {
|
||||
return o.ToFormat()
|
||||
}
|
||||
|
||||
func (o *Asset) ToFormat() *format.ReleaseAsset {
|
||||
return &format.ReleaseAsset{
|
||||
Common: format.NewCommon(o.ID),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue