Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/uber-go/mapdecode

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/uber-go/mapdecode

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

mapdecode GoDoc Build Status Coverage Status

mapdecode implements a generic interface{} decoder. It allows implementing custom YAML/JSON decoding logic only once. Instead of implementing the same UnmarshalYAML and UnmarshalJSON twice, you can implement Decode once, parse the YAML/JSON input into a map[string]interface{} and decode it using this package.

var data map[string]interface{}
if err := json.Decode(&data, input); err != nil {
    log.Fatal(err)
}

var result MyStruct
if err := mapdecode.Decode(&result, data); err != nil {
    log.Fatal(err)
}

This package relies heavily on mapstructure for much of its functionality.

Status

Stable: No breaking changes will be made before 2.0.


Released under the MIT License.

FAQs

Package last updated on 29 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc