Skip to content

Commit

Permalink
Merge pull request #13 from lawzava/fix/runtime-issues
Browse files Browse the repository at this point in the history
🐛 tiny fixes to large problems
  • Loading branch information
lawzava authored Dec 1, 2022
2 parents 61d5648 + 0f5c940 commit d9a8464
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /build

COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install -installsuffix cgo -ldflags '-extldflags "-static"' ./cmd/...
RUN CGO_ENABLED=0 GOOS=linux go install -installsuffix cgo -ldflags '-extldflags "-static"' ./cmd/...

# Run app in scratch
FROM scratch
Expand Down
7 changes: 2 additions & 5 deletions internal/pkg/config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,15 @@ func (fe fileStructureElement) prepareConfigElement(log *logger.Log) (App, error
}
}

broadcastConfig := broadcast.Config{
StdOut: broadcast.NewStdOutClient(),
Telegram: nil,
}
cfg.Broadcast = broadcast.NewStdOutClient()

if fe.BroadcastType == "TELEGRAM" {
telegramClient, err := broadcast.NewTelegramClient(fe.TelegramBotAPIToken, fe.TelegramChatID)
if err != nil {
return App{}, fmt.Errorf("failed to create telegram client: %w", err)
}

broadcastConfig.Telegram = telegramClient
cfg.Broadcast = telegramClient
}

return cfg, nil
Expand Down

0 comments on commit d9a8464

Please # to comment.