Use pointer receiver more offen
This commit is contained in:
parent
6999b4e728
commit
c7569b5e54
59 changed files with 688 additions and 672 deletions
|
@ -19,7 +19,7 @@ type IssueUpload struct {
|
|||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
func treatIssue(pathname string, team fic.Team) {
|
||||
func treatIssue(pathname string, team *fic.Team) {
|
||||
// Generate a unique identifier to follow the request in logs
|
||||
bid := make([]byte, 5)
|
||||
binary.LittleEndian.PutUint32(bid, rand.Uint32())
|
||||
|
@ -50,7 +50,7 @@ func treatIssue(pathname string, team fic.Team) {
|
|||
log.Printf("%s [ERR] %s\n", id, err)
|
||||
}
|
||||
log.Printf("%s Empty issue: not treated.\n", id)
|
||||
} else if desc, err := claim.AddDescription(issue.Description, fic.ClaimAssignee{Id: 0}, true); err != nil {
|
||||
} else if desc, err := claim.AddDescription(issue.Description, &fic.ClaimAssignee{Id: 0}, true); err != nil {
|
||||
log.Printf("%s [WRN] Unable to add description to issue: %s\n", id, err)
|
||||
} else {
|
||||
claim.State = "new"
|
||||
|
@ -65,13 +65,13 @@ func treatIssue(pathname string, team fic.Team) {
|
|||
} else {
|
||||
var exercice *fic.Exercice = nil
|
||||
if e, err := fic.GetExercice(issue.IdExercice); err == nil {
|
||||
exercice = &e
|
||||
exercice = e
|
||||
}
|
||||
|
||||
if claim, err := fic.NewClaim(issue.Subject, &team, exercice, nil, "medium"); err != nil {
|
||||
if claim, err := fic.NewClaim(issue.Subject, team, exercice, nil, "medium"); err != nil {
|
||||
log.Printf("%s [ERR] Unable to create new issue: %s\n", id, err)
|
||||
} else if len(issue.Description) > 0 {
|
||||
if _, err := claim.AddDescription(issue.Description, fic.ClaimAssignee{Id: 0}, true); err != nil {
|
||||
if _, err := claim.AddDescription(issue.Description, &fic.ClaimAssignee{Id: 0}, true); err != nil {
|
||||
log.Printf("%s [WRN] Unable to add description to issue: %s\n", id, err)
|
||||
} else {
|
||||
log.Printf("%s [OOK] New issue created: id=%d\n", id, claim.Id)
|
||||
|
|
Reference in a new issue