diff --git a/app.go b/app.go index 626b615..826dba8 100644 --- a/app.go +++ b/app.go @@ -2,6 +2,7 @@ package gomeassistant import ( "context" + "fmt" "log" "os" "time" @@ -139,7 +140,7 @@ func getSunriseSunset(a *app, sunrise bool, offset []DurationString) carbon.Carb // get next sunrise/sunset time from HA state, err := a.state.Get("sun.sun") if err != nil { - panic("Couldn't get sun.sun state from HA to calculate", printString) + panic(fmt.Sprintf("Couldn't get sun.sun state from HA to calculate %s", printString)) } nextSetOrRise := carbon.Parse(state.Attributes[attrKey].(string)) diff --git a/internal/websocket/websocket.go b/internal/websocket/websocket.go index ff4b1b1..376f474 100644 --- a/internal/websocket/websocket.go +++ b/internal/websocket/websocket.go @@ -132,7 +132,7 @@ func SubscribeToEventType(eventType string, conn *websocket.Conn, ctx context.Co } err := WriteMessage(e, conn, ctx) if err != nil { - panic("Error writing to websocket: ", err) + panic(fmt.Sprintf("Error writing to websocket: %s", err)) } // m, _ := ReadMessage(conn, ctx) // log.Default().Println(string(m))