1
0
Fork 0
forked from forgejo/forgejo

[F3] upgrade to gof3 50a6e740ac04

Add new methods GetIDString() & SetIDString() & ToFormatInterface()
Change the prototype of the fixture function

(cherry picked from commit d7b263ff8b)
(cherry picked from commit b3eaf2249d)
This commit is contained in:
Earl Warren 2023-06-28 15:57:57 +02:00
parent d143e5b2a3
commit d492ddd9bb
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
16 changed files with 154 additions and 4 deletions

View file

@ -35,10 +35,18 @@ func (o PullRequest) GetID() int64 {
return o.Index
}
func (o PullRequest) GetIDString() string {
return fmt.Sprintf("%d", o.GetID())
}
func (o *PullRequest) SetID(id int64) {
o.Index = id
}
func (o *PullRequest) SetIDString(id string) {
o.SetID(util.ParseInt(id))
}
func (o *PullRequest) IsNil() bool {
return o.Index == 0
}
@ -51,6 +59,10 @@ func (o PullRequest) IsForkPullRequest() bool {
return o.HeadRepoID != o.BaseRepoID
}
func (o *PullRequest) ToFormatInterface() format.Interface {
return o.ToFormat()
}
func (o *PullRequest) ToFormat() *format.PullRequest {
var milestone string
if o.Issue.Milestone != nil {