package main

import (
  "fmt"
  "os"
  "github.com/mattn/go-gtk/gtk"
  "ghighlighter/windows"
  "ghighlighter/models"
  "ghighlighter/utils"
)

func main() {
  initializeEnvironment()
  gtk.Init(nil)

  mainWindow := windows.MainWindow()
  window := mainWindow.GtkWindow
  window.ShowAll()

  config := models.Config()
  if config.AccessToken == "" {
    fmt.Println("No access token, show authentication window")
  }

  gtk.Main()
}

func initializeEnvironment() {
  dataDir := utils.DataDir()
  error := os.Mkdir(dataDir, 0755)
  if error != nil && !os.IsExist(error) { os.Exit(1) }
}


package main

import (
  "fmt"
  "os"
  "github.com/mattn/go-gtk/gtk"
  "ghighlighter/windows"
  "ghighlighter/models"
  "ghighlighter/utils"
)

func main() {
  initializeEnvironment()
  gtk.Init(nil)

  mainWindow := windows.MainWindow()
  window := mainWindow.GtkWindow
  window.ShowAll()

  gtk.Main()
}

func initializeEnvironment() {
  dataDir := utils.DataDir()
  error := os.Mkdir(dataDir, 0755)
  if error != nil && !os.IsExist(error) { os.Exit(1) }
}


--- 
+++ 
@@ -17,6 +17,11 @@
   window := mainWindow.GtkWindow
   window.ShowAll()
 
+  config := models.Config()
+  if config.AccessToken == "" {
+    fmt.Println("No access token, show authentication window")
+  }
+
   gtk.Main()
 }
 
Add dummy handling of empty access token on startup
