json2struct

command module
v0.0.0-...-c469508 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 5 Imported by: 0

README

JSON2Struct

Converts JSON file to Go structs and initializer function.

  • supports JSONC format with comments

Installation

go get -u github.com/modulo-srl/mu-config/json2struct

Example usage with Go-generate

Generate structs declarations and initializers, using default parameters: //go:generate json2struct -out=config-data.go ../bin/settings-default.jsonc

Generate (to stdout) package "settings" and "settingsData" struct declaraction, without warning header, initializers and raw content: //go:generate json2struct -pkg="settings" -declare="settingsData" -values="" -warn=false --raw="" ../bin/settings-default.jsonc

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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