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

クローズ
3 年 前david によって開かれました · 1 コメント
David Thielemann3 年 前 にコメントしました
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 この課題がコミット 3 年 前 から参照されました
stevet 3 年 前 に閉じられました
Steve Thielemann この課題がコミット 3 年 前 から参照されました
David Thielemann3 年 前 にコメントしました
オーナー

Tests for the win!

Tests for the win!
Steve Thielemann この課題がコミット 3 年 前 から参照されました
会話に参加するには サインイン してください。
マイルストーンなし
担当者なし
1 参加者
読み込み中…
キャンセル
保存
まだコンテンツがありません