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

Fermé
Créé il y a 3 ans par david · 1 commentaires
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)
Steve Thielemann a référencé ce problème à partir d'un commit il y a 3 ans
Steve Thielemann a référencé ce problème à partir d'un commit il y a 3 ans
David Thielemann a commenté il y a 3 ans
Propriétaire

Tests for the win!

Tests for the win!
Steve Thielemann a référencé ce problème à partir d'un commit il y a 3 ans
Connectez-vous pour rejoindre cette conversation.
Aucun jalon
Pas d'assignataire
1 Participants
Chargement…
Annuler
Enregistrer
Il n'existe pas encore de contenu.