hjson

package
v0.0.0-...-0e50cdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2018 License: MIT Imports: 4 Imported by: 8

README

hjson

A HJSON (http://hjson.org) parser and unmarshaller written in Go

A scant 200 lines implements a HJSON parser, with full unmarshalling support, in Go.

How? It takes an HJSON input and converts it to JSON, and lets the native Golang parser do the hard stuff.

Differences and/or bugs:
  • Unquoted strings have trailing whitespace removed.
  • Strings can be quoted using single quote, e.g. 'foo'.
  • Multi-line strings can also be started with double quote, e.g. """
  • Likely to be some encoding issues, please file bugs.
  • Likely edge cases with multi-line strings, please file bugs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(r io.Reader) io.Reader

New returns an io.Reader that converts a HJSON input to JSON

func ToJSON

func ToJSON(raw []byte) []byte

ToJSON converts a hjson format to JSON

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal is the same as JSON.Unmarshal but for HJSON files

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL