j2s

command module
v0.0.0-...-280c4d0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2016 License: MIT Imports: 10 Imported by: 0

README

j2s Build Status

j2s is a cmd tool generate golang struct from JSON

example

cat example.json | ./j2s > example_output.go

package main

type Financial struct {
	Basic  string  `json:"basic"`
	Items  []Items `json:"items"`
	Normal float64 `json:"normal"`
	Unit   Unit    `json:"unit"`
}

type UnitTwo struct {
	Price         string `json:"price"`
	PriceQuantity string `json:"price_quantity"`
	Quantity      string `json:"quantity"`
}

type Items struct {
	EntrustRate   float64   `json:"entrust_rate"`
	GoodsTypeName string    `json:"goods_type_name"`
	ItemID        string    `json:"item_id"`
	ItemType      string    `json:"item_type"`
	ItemTypeID    float64   `json:"item_type_id"`
	ManifestName  string    `json:"manifest_name"`
	PaymentRate   float64   `json:"payment_rate"`
	Price         float64   `json:"price"`
	Quantity      float64   `json:"quantity"`
	SerialNumber  string    `json:"serial_number"`
	UnitTwo       []UnitTwo `json:"unit_two"`
}
type Unit struct {
	Price         string `json:"price"`
	PriceQuantity string `json:"price_quantity"`
	Quantity      string `json:"quantity"`
}

Installation

$ go get github.com/lubia/j2s
  • github.com/tmc/json-to-struct

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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