Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G go
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • go
  • Repository
  • go
  • src
  • encoding
  • json
  • encode.go
Find file BlameHistoryPermalink
  • Håvard Haugen's avatar
    encoding/json: fix decoding of types with '[]byte' as underlying type · 4302fd04
    Håvard Haugen authored Apr 26, 2015
    All slice types which have elements of kind reflect.Uint8 are marshalled
    into base64 for compactness. When decoding such data into a custom type
    based on []byte the decoder checked the slice kind instead of the slice
    element kind, so no appropriate decoder was found.
    
    Fixed by letting the decoder check slice element kind like the encoder.
    This guarantees that already encoded data can still be successfully
    decoded.
    
    Fixes #8962.
    
    Change-Id: Ia320d4dc2c6e9e5fe6d8dc15788c81da23d20c4f
    Reviewed-on: https://go-review.googlesource.com/9371
    
    
    Reviewed-by: default avatarPeter Waldschmidt <peter@waldschmidt.com>
    Reviewed-by: default avatarRuss Cox <rsc@golang.org>
    4302fd04
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7