Skip to content

A simple application to convert JSON data to go struct.

License

Notifications You must be signed in to change notification settings

swathinsankaran/jsonToStruct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonToStruct

A simple application to convert JSON data to go struct.

Example:

A sample JSON input to the application

{
  "name": "Barksalot",
  "species": "Dog",
  "age": 5,
  "photo": "https://learnwebcode.github.io/json-example/images/dog-1.jpg"
}

gets converted to the following struct.

type auto struct { 
  Name          string	`json:"name"`
  Species       string	`json:"species"`
  Age           int	`json:"age"`
  Photo         string	`json:"photo"`
}

Application in action

json-to-struct

App in action #2

Usage

./jsonToStruct <file1.json> <file2.json> ..

Installation

cd jsonToStruct
make exe

Dependencies (using go modules)

prerequisites

  • Golang 1.11

Todos

  • Write Unit Tests
  • Add and test with more JSON examples

About

A simple application to convert JSON data to go struct.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published