#5 Saving a ircclient.IRCConfig struct to JSON file returns error

Uzavrená
otvorené 3 rokov pred užívateľom david · 1 komentárov
lunar-bot: Start up...
panic: json: unsupported type: func()

goroutine 1 [running]:
log.Panic({0xc0000bdf38?, 0x572e7b?, 0xa?})
    /usr/local/go/src/log/log.go:385 +0x65
main.main()
    /home/apollo/dev/go/lunar-bot/lunar.go:105 +0x185

It was attempting to json.Marshal the OnExit function.

To mark something as ignore on marshaling and unmarshaling use `json:"-"`.

See https://stackoverflow.com/a/17306470

``` lunar-bot: Start up... panic: json: unsupported type: func() goroutine 1 [running]: log.Panic({0xc0000bdf38?, 0x572e7b?, 0xa?}) /usr/local/go/src/log/log.go:385 +0x65 main.main() /home/apollo/dev/go/lunar-bot/lunar.go:105 +0x185 ``` It was attempting to json.Marshal the OnExit function. To mark something as ignore on marshaling and unmarshaling use \``json:"-"`\`. > See [https://stackoverflow.com/a/17306470](https://stackoverflow.com/a/17306470)
stevet zatvorené 3 rokov pred
Steve Thielemann sa odvolal na túto issue z commitu 3 rokov pred
David Thielemann okomentoval 3 rokov pred
Vlastník

Tests for the win!

Tests for the win!
Prihláste sa pre zapojenie do konverzácie.
Žiadny míľnik
Žiadny priradený
1 účastníkov
Načítavanie...
Zrušiť
Uložiť
Zatiaľ neexistuje žiadny obsah.