Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang-Red committed Oct 11, 2024
1 parent a322544 commit 1da3061
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,38 @@ func DrawRankingCard(fontdata []byte, title string, toplefttext, bottomlefttext,
canvas.ParseFontFace(fontdata, 32)

Check failure on line 87 in rank.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `canvas.ParseFontFace` is not checked (errcheck)
canvas.DrawStringAnchored(title, w/2, 64/2, 0.5, 0.5)

canvas.ParseFontFace(fontdata, 20)
err = canvas.ParseFontFace(fontdata, 20)
if err != nil {
return
}
wg.Wait()
for i := 0; i < 10; i++ {
canvas.DrawImage(cardimgs[i], 0, 0)
canvas.DrawStringAnchored(toplefttext[i], 16+10+60+10, hspac+(cardspac+cardh)*float64(i)+cardh*3/8, 0, 0.5)
}

canvas.SetRGBA255(63, 63, 63, 255)
canvas.ParseFontFace(fontdata, 12)
err = canvas.ParseFontFace(fontdata, 12)
if err != nil {
return
}
for i := 0; i < 10; i++ {
canvas.DrawStringAnchored(bottomlefttext[i], 16+10+60+10, hspac+(cardspac+cardh)*float64(i)+cardh*5/8, 0, 0.5)
}
canvas.SetRGBA255(0, 0, 0, 255)
canvas.ParseFontFace(fontdata, 24)
err = canvas.ParseFontFace(fontdata, 24)
if err != nil {
return
}
for i := 0; i < 10; i++ {
canvas.DrawStringAnchored(righttext[i], w-16-8-50-8, hspac+(cardspac+cardh)*float64(i)+cardh/2, 1, 0.5)
}

canvas.SetRGBA255(255, 255, 255, 255)
canvas.ParseFontFace(fontdata, 28)
err = canvas.ParseFontFace(fontdata, 28)
if err != nil {
return
}
for i := 0; i < 10; i++ {
canvas.DrawStringAnchored(strconv.Itoa(i+1), w-16-8-25, hspac+(cardspac+cardh)*float64(i)+cardh/2, 0.5, 0.5)
}
Expand Down

0 comments on commit 1da3061

Please sign in to comment.