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