Skip to content

Commit

Permalink
Fix build error when using Go 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marksamman committed Jan 13, 2015
1 parent 7580281 commit 8d29b8c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@ func (decoder *decoder) readInt() (interface{}, error) {
return decoder.readIntUntil('e')
}

func (decoder *decoder) readInterfaceType(identifier byte) (interface{}, error) {
func (decoder *decoder) readInterfaceType(identifier byte) (item interface{}, err error) {
switch identifier {
case 'i':
return decoder.readInt()
item, err = decoder.readInt()
case 'l':
return decoder.readList()
item, err = decoder.readList()
case 'd':
return decoder.readDictionary()
item, err = decoder.readDictionary()
default:
if err := decoder.UnreadByte(); err != nil {
return nil, err
}
return decoder.readString()
item, err = decoder.readString()
}
return item, err
}

func (decoder *decoder) readList() ([]interface{}, error) {
Expand Down

0 comments on commit 8d29b8c

Please sign in to comment.