GoJsoner

package module
v0.0.0-...-3e13415 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 2 Imported by: 3

README

GoJsoner

Loading JSON file in Golang and discarding comments.

Installation

Install GoJsoner using the "go get" command:

go get github.com/sipt/GoJsoner

Examples

result, err := Discard(`
		{//test comment1
			"name": "测试",
			/**
			test comment2
			1
			2
			3
			end
			*/
			"age":26 //test comment3
			/*****/
		}
	`)

output

{"name":"测试","age":26}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Maches = []Map{
	Map{"start": "//", "end": "\n"},
	Map{"start": "/*", "end": "*/"},
}

Maches discard from "start" to "end"

Functions

func Discard

func Discard(content string) (string, error)

Discard discarding comments @params:content @resturns: string simple json

Types

type Map

type Map map[string]string

Map alias map[string]string

type Stack

type Stack []rune

Stack rune stack

func (Stack) Pop

func (s Stack) Pop() (rune, error)

Pop stack pop

func (Stack) Push

func (s Stack) Push(r rune)

Push stack push

Jump to

Keyboard shortcuts

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