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

닫힘
david3 년 전을 오픈 · 1개의 코멘트
David Thielemann 코멘트됨, 3 년 전
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 3 년 전가 Close
Steve Thielemann 커밋 3 년 전에서 이 이슈 언급
David Thielemann 코멘트됨, 3 년 전
소유자

Tests for the win!

Tests for the win!
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 1명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.