• Stars
    star
    11
  • Rank 1,694,829 (Top 34 %)
  • Language
    Go
  • License
    MIT License
  • Created about 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JSONC (json with comments) to JSON translator for Golang.

JSONcJSON

Version Go Report Card Coverage Status PkgGoDev

The library provides a JSONC (json with comments) to JSON streamer. It supports multiline comments ( /* Comment */) and one-line comments ( // Comment ). It processes chunks of 512 bytes in place.

For example, it translates JSON with comments:

{
    /*
        JSONcJSON
        =^._.^= ∫
    */
    "Hello": "world" // In-line comments are also supported.
}

to a valid JSON:

{
    "Hello": "world"
}

Installing:

go get github.com/hedhyw/jsoncjson

Usage example:

More examples.

// Converting jsonc to json and decoding.

const in = `
{
    "Hello": "world"
    /* Perhaps the truth depends on a walk around the lake. */
}
`

// The reader can be anything.
// For example: file, strings.NewReader(), bytes.NewReader(), ...
var r = jsoncjson.NewReader(strings.NewReader(in))

var data map[string]interface{}
_, = json.NewDecoder(r).Decode(&data)

fmt.Printf("%+v\n", data) // map[Hello:world].

More Repositories

1

rex

Flexible regular expressions constructor for Golang.
Go
194
star
2

gherkingen

Behaviour Driven Development tests generator for Golang
Go
72
star
3

json-log-viewer

Interactive viewer for JSON logs.
Go
71
star
4

spice3f5

Add cmake to spice3f5 for build in linux or windows. SPICE is a general-purpose circuit simulator with several built-in semiconductor device models. SPICE was developed at the Electronics Research Laboratory of the University of California, Berkeley.
C
36
star
5

BrillouinZones

Programs for constructing Brillouin zones in three- and two-dimensional space.
Python
28
star
6

otelinji

OpenTelemetry auto-instrumentation tool for Golang. It automatically injects OpenTelemetry blocks.
Go
16
star
7

go-import-lint

Golang source code analyzer that checks imports order. It verifies that standard, current package, and vendor imports are separated by a line.
Go
16
star
8

Go-Serial-Detector

A go library for determining active serial ports.
Go
14
star
9

Directory

Directory & File Chooser dialog for Android
Java
6
star
10

semerr

A way of dealing with Golang errors
Go
6
star
11

HyperFractal

A three-dimensional fractal animation generator.
C++
6
star
12

DinoMega8

Firmware of the Dino game for microcontroller ATmega8
C
4
star
13

DielectricBreakdown

Source codes of programs for a designed device. The device measures the parameters of dielectric films.
C
3
star
14

CExpr

Math Complex Expression Compiler
Java
3
star
15

go-ipbot

Hello-Telegram-Bot that sends the IP address of a remote machine
Go
3
star
16

beehivedlna

Webpage
CSS
2
star
17

LogNotifierBot

Bot for the telegram that sends new messages from sshd/auth.log.
Java
2
star
18

Ocmoxa-Vietblog

The blog with Vietnamese stories for language learners. 🌴 πŸ‡»πŸ‡³ πŸ₯₯
HTML
2
star
19

go-psw

A tiny secure-random password generator
Go
2
star
20

telegram-pictionary-it

Telegram MiniApp bot game in which players can draw and guess pictures
Makefile
2
star
21

simple-4bit-cpu

Vivado project with example of simple 4bit CPU
Verilog
2
star
22

Vietnamese-Notes

The blog with brief Vietnamese language notes and an awesome Vietnamese resources list
HTML
1
star
23

Right-Angle-Build

Right Angle Website
HTML
1
star
24

telegram-pictionary-it-backend

Backend for "Pictionary It telegram" bot
Go
1
star
25

telegram-mic-guitar-tuner

@micguitartunerbot is a Telegram Mini App that helps to tune guitars
JavaScript
1
star
26

bdd-resizer-example

JPEG image resizer server for a Golang article
Go
1
star
27

go-tarantool-structure

Go
1
star
28

ippserver-docker

A small docker image which pretends to be a printer.
Makefile
1
star
29

telegram-pictionary-it-frontend

Frontend for "Pictionary It telegram" bot
JavaScript
1
star
30

vscode-golang-gherkingen

VS-Code extension to generate Golang Behaviour Driven Development (BDD) tests
TypeScript
1
star
31

homebrew-main

Collection of homebrews
Ruby
1
star