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