asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

question about log #80

Open linclt opened 2 years ago

linclt commented 2 years ago

I find this :Cannot use 'l' (type *Logger) as the type astikit.StdLogger Type does not implement 'astikit.StdLogger', how can I fix it?

l := log.New(log.Writer(), log.Prefix(), log.Flags())

// Parse flags
fs.Parse(os.Args[1:])

// Run bootstrap
l.Printf("Running app built at %s\n", BuiltAt)
if err := bootstrap.Run(bootstrap.Options{
    Asset:    Asset,
    AssetDir: AssetDir,
    AstilectronOptions: astilectron.Options{
        AppName:            AppName,
        AppIconDarwinPath:  "resources/icon.icns",
        AppIconDefaultPath: "resources/icon.png",
        SingleInstance:     true,
        VersionAstilectron: VersionAstilectron,
        VersionElectron:    VersionElectron,
    },
    Debug: *debug,
    Logger: l,
    MenuOptions: []*astilectron.MenuItemOptions{{
        Label: astikit.StrPtr("File"),
        SubMenu: []*astilectron.MenuItemOptions{
            {
asticode commented 2 years ago

which version of go are you using ? 🤔

linclt commented 2 years ago

the latest version, i think

asticode commented 2 years ago

can you tell me the output of go version to be sure ?

linclt commented 2 years ago

go version go1.18 windows/amd64

linclt commented 2 years ago

it`s caused by go version 1.18, when change the golang version to 1.17.6 and the problem disappears

asticode commented 2 years ago

This is weird because I've just tested in go 1.18 and this is working for me 🤔

Do you have more info in the error message like the function that is not properly implemented ?