Formatting of the previous commit

This commit is contained in:
2025-01-14 14:45:45 +00:00
parent 90a0321e9f
commit 172fa4ff52
2 changed files with 6 additions and 7 deletions
+6 -6
View File
@@ -57,25 +57,25 @@ func msToKph(v float32) int {
} }
func main() { func main() {
// Open the data source file // Open the data source file
file, err := os.Open("/path/to/ibtFile") file, err := os.Open("/path/to/ibtFile")
if err != nil { if err != nil {
log.Fatalf("Failed to open IBT file: %v", err) log.Fatalf("Failed to open IBT file: %v", err)
} }
// Instantiate our iRacing SDK instance // Instantiate our iRacing SDK instance
irsdk, err := goirsdk.Init(file, "", "") irsdk, err := goirsdk.Init(file, "", "")
if err != nil { if err != nil {
log.Fatalf("Failed to create iRacing interface: %v", err) log.Fatalf("Failed to create iRacing interface: %v", err)
} }
defer irsdk.Close() defer irsdk.Close()
// Set up a loop to iterate our data // Set up a loop to iterate our data
mainLoopTicker := time.NewTicker(time.Second / 60) mainLoopTicker := time.NewTicker(time.Second / 60)
defer mainLoopTicker.Stop() defer mainLoopTicker.Stop()
for { for {
// Update the data that the SDK is holding with the next tick // Update the data that the SDK is holding with the next tick
_, err := irsdk.Update(100 * time.Millisecond) _, err := irsdk.Update(100 * time.Millisecond)
if err != nil { if err != nil {
log.Printf("could not update data: %v", err) log.Printf("could not update data: %v", err)
@@ -83,8 +83,8 @@ func main() {
} }
// Vehicle Movement data gathered from the names we can find on the // Vehicle Movement data gathered from the names we can find on the
// telemetry_docs.pdf file // telemetry_docs.pdf file
// - I wish to make this less verbose if possible // - I wish to make this less verbose if possible
if _, ok := irsdk.Vars.Vars["Gear"]; !ok { if _, ok := irsdk.Vars.Vars["Gear"]; !ok {
log.Fatal("Field `Gear` doesn't exist") log.Fatal("Field `Gear` doesn't exist")
} }
-1
View File
@@ -64,4 +64,3 @@ func main() {
<-mainLoopTicker.C <-mainLoopTicker.C
} }
} }