mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 12:41:14 +08:00
32 lines
582 B
Go
32 lines
582 B
Go
package main
|
|
|
|
import (
|
|
_ "embed"
|
|
"log"
|
|
|
|
"github.com/BurntSushi/toml"
|
|
)
|
|
|
|
//go:embed FyneApp.toml
|
|
var FyneAppToml string
|
|
|
|
type FyneAppConfig struct {
|
|
Website string `toml:"Website"`
|
|
Details struct {
|
|
Icon string `toml:"Icon"`
|
|
Name string `toml:"Name"`
|
|
ID string `toml:"ID"`
|
|
Version string `toml:"Version"`
|
|
Build int `toml:"Build"`
|
|
} `toml:"Details"`
|
|
}
|
|
|
|
func GetVersion() string {
|
|
var config FyneAppConfig
|
|
if _, err := toml.Decode(FyneAppToml, &config); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
return config.Details.Version
|
|
}
|