Skip to content

Commit

Permalink
Remove calls to panic in favor of log.Fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlkzdh committed Sep 12, 2024
1 parent 4124494 commit 743a84a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/snowmint/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"log"

"github.com/mxmlkzdh/snowmint/config"
"github.com/mxmlkzdh/snowmint/internal/id"
"github.com/mxmlkzdh/snowmint/internal/tcp"
Expand All @@ -10,10 +12,10 @@ func main() {
cfg := config.LoadConfig()
uniqueIDGenerator, err := id.NewUniqueIDGenerator(cfg.DataCenterID, cfg.NodeID, cfg.Epoch)
if err != nil {
panic(err)
log.Fatal(err)
}
server := tcp.NewServer(cfg.Address, cfg.Port, uniqueIDGenerator)
if err := server.ListenAndServe(); err != nil {
panic(err)
log.Fatal(err)
}
}

0 comments on commit 743a84a

Please sign in to comment.