config.go 820 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. ******************************************************************************
  3. * @file config.go
  4. * @author MakerYang
  5. ******************************************************************************
  6. */
  7. package Config
  8. import (
  9. "embed"
  10. "encoding/json"
  11. "golang.org/x/sync/errgroup"
  12. )
  13. var Get = &Data{}
  14. type Data struct {
  15. Info struct {
  16. CompanyName string `json:"companyName"`
  17. ProductName string `json:"productName"`
  18. ProductVersion string `json:"productVersion"`
  19. } `json:"info"`
  20. Group errgroup.Group
  21. }
  22. func Init(version embed.FS) {
  23. wails, _ := version.ReadFile("wails.json")
  24. var wailsJson Data
  25. json.Unmarshal(wails, &wailsJson)
  26. Get.Info.ProductVersion = wailsJson.Info.ProductVersion
  27. Get.Info.ProductName = wailsJson.Info.ProductName
  28. Get.Info.CompanyName = wailsJson.Info.CompanyName
  29. }