Skip to content

Commit

Permalink
fix: golint
Browse files Browse the repository at this point in the history
  • Loading branch information
OldTyT committed Feb 3, 2024
1 parent edc7787 commit d8d8dc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"strconv"
)

// const Version string = "v0.0.1"

type Config struct {
Debug bool
TelegramBotToken string
Expand Down
3 changes: 0 additions & 3 deletions internal/frigate/frigate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"io"
"net/http"
"os"
"reflect"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -73,8 +72,6 @@ type EventStruct struct {

var Events EventsStruct
var Event EventStruct
var floatType = reflect.TypeOf(float64(0))
var stringType = reflect.TypeOf("")

func GETZones(Zones []any) []string {
var my_zones []string
Expand Down
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import (
"github.com/oldtyt/frigate-telegram/internal/log"
)

// FrigateEvents is frigate events struct
var FrigateEvents frigate.EventsStruct

// FrigateEvent is frigate event struct
var FrigateEvent frigate.EventStruct

// PongBot is needed to check the work of the bot.
func PongBot(bot *tgbotapi.BotAPI) {
u := tgbotapi.NewUpdate(0)
u.Timeout = 60
Expand Down Expand Up @@ -59,10 +63,9 @@ func main() {
conf := config.New()

// Prepare startup msg
startup_msg := "Starting frigate-telegram.\n"
// startup_msg += "Version: " + config.Version + "\n"
startup_msg += "Frigate URL: " + conf.FrigateURL + "\n"
log.Info.Println(startup_msg)
startupMsg := "Starting frigate-telegram.\n"
startupMsg += "Frigate URL: " + conf.FrigateURL + "\n"
log.Info.Println(startupMsg)

// Initializing telegram bot
bot, err := tgbotapi.NewBotAPI(conf.TelegramBotToken)
Expand All @@ -73,7 +76,7 @@ func main() {
log.Info.Println("Authorized on account " + bot.Self.UserName)

// Send startup msg.
_, errmsg := bot.Send(tgbotapi.NewMessage(conf.TelegramChatID, startup_msg))
_, errmsg := bot.Send(tgbotapi.NewMessage(conf.TelegramChatID, startupMsg))
if errmsg != nil {
log.Error.Println(errmsg.Error())
}
Expand Down

0 comments on commit d8d8dc7

Please sign in to comment.