Skip to content

Commit

Permalink
chore: no side effects (#68)
Browse files Browse the repository at this point in the history
* chore: test no side effects

* debug

* chore: sometimes its not empty its just 0
  • Loading branch information
kashalls authored Aug 16, 2024
1 parent cb4e9fc commit b8f6de9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/kromgo/kromgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ type KromgoHandler struct {
func NewKromgoHandler(config configuration.KromgoConfig) (*KromgoHandler, error) {
var badgeGenerator *badge.Generator

if config.Badge.Font == "" {
// This font is included in the container by default.
config.Badge.Font = "Verdana.ttf"
font := config.Badge.Font
if font == "" {
font = "Verdana.ttf"
}

if config.Badge.Size < 0 {
config.Badge.Size = 11
size := config.Badge.Size
if size <= 0 {
size = 11
}

badgeGenerator, err := badge.NewGenerator(config.Badge.Font, config.Badge.Size)
badgeGenerator, err := badge.NewGenerator(font, size)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b8f6de9

Please sign in to comment.