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 commitd7b263ff8b
) (cherry picked from commitb3eaf2249d
)
This commit is contained in:
parent
d143e5b2a3
commit
d492ddd9bb
16 changed files with 154 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue