GoStruct2Table - format your struct like a table.

GoStruct2Table

format your struct like a table.

Installing

$ go get -u -v github.com/runningzyp/GoStruct2Table

Simple Example

import parser "github.com/runningzyp/GoStruct2Table"

var p = struct {
	Name    string
	Age     int
	Address string
}{
	Name:    "xiangcai",
	Age:     18,
	Address: "shanghai",
}

parser.Parse(p)
+----------+--------------------+---------------------------+
|ROOT      |KEY                 |VALUE                      |
+----------+--------------------+---------------------------+
|          |Name                |xiangcai                   |
|          |Age                 |18                         |
|          |Address             |shanghai                   |
+----------+--------------------+---------------------------+

Nested:

type Nested struct {
	Core int
}
var p = struct {
	Name    string
	Age     int
	Address string
	Nested  Nested
}{
	Name:    "xiangcai",
	Age:     18,
	Address: "shanghai",
	Nested:  Nested{Core: 1},
}
+----------+--------------------+---------------------------+
|ROOT      |KEY                 |VALUE                      |
+----------+--------------------+---------------------------+
|          |Name                |xiangcai                   |
|          |Age                 |18                         |
|          |Address             |shanghai                   |
+----------+--------------------+---------------------------+
|Nested    |Core                |1                          |
+----------+--------------------+---------------------------+
Owner
YunpengZhan
日々私たちが過ごしている日常は、実は、奇跡の連続なのかもしれない
YunpengZhan
Similar Resources

publish a tree-like data structure from a backend to a front-end

tree-publish publish a tree-like data structure from a backend to a front-end. It needs to be a tree in order to publish the data as JSON document. If

Dec 20, 2021

ZSet is an in-memory Redis like sorted set datastructure

zset Getting Started Installing To start using hash, install Go and run go get: $ go get -u github.com/arriqaaq/zset This will retrieve the library. U

Oct 13, 2022

☔️ A complete Go cache library that brings you multiple ways of managing your caches

☔️ A complete Go cache library that brings you multiple ways of managing your caches

Gocache Guess what is Gocache? a Go cache library. This is an extendable cache library that brings you a lot of features for caching data. Overview He

Jan 1, 2023

Custom generic HTTP handler providing automatic JSON decoding/encoding of HTTP request/response to your concrete types

gap Custom generic HTTP handler providing automatic JSON decoding/encoding of HTTP request/response to your concrete types. gap.Wrap allows to use the

Aug 28, 2022

🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.

🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.

toc toc TOC, table of content generator for Markdown files Table of Contents Table of Contents Usage Installation Packages Arch Linux Homebrew Docker

Dec 29, 2022

Bubble-table - A table component for the Bubble Tea framework

Bubble-table - A table component for the Bubble Tea framework

Bubble-table A table component for the Bubble Tea framework. This is currently m

Dec 23, 2022

☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

Gormat - Cross platform gopher tool The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct. 中文说明 Features Data

Dec 20, 2022

Golang struct-to-table database mapper

Structable: Struct-Table Mapping for Go Warning: This is the Structable 4 development branch. For a stable release, use version 3.1.0. Structable deve

Dec 27, 2022

goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configuration file.

goconfig goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configur

Dec 15, 2022

Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and struct tags for golang crawler

Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and struct tags for golang crawler

Pagser Pagser inspired by page parser。 Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and str

Dec 13, 2022

Match regex group into go struct using struct tags and automatic parsing

regroup Simple library to match regex expression named groups into go struct using struct tags and automatic parsing Installing go get github.com/oris

Nov 5, 2022

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving

Package validator Package validator implements value validations for structs and individual fields based on tags. It has the following unique features

Jan 1, 2023

Copier for golang, copy value from struct to struct and more

Copier I am a copier, I copy everything from one to another Features Copy from field to field with same name Copy from method to field with same name

Jan 8, 2023

💯 Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving

Package validator implements value validations for structs and individual fields based on tags.

Nov 9, 2022

Go generator to copy values from type to type and fields from struct to struct. Copier without reflection.

Copygen is a command-line code generator that generates type-to-type and field-to-field struct code without adding any reflection or dependenc

Dec 29, 2022

The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

Oct 27, 2021

Read metrics from a Message Queue in Json format and expose them in a Prometheus compatible format

mq2prom Read metrics from a Message Queue in Json format and expose them in a Prometheus compatible format. Currently only works for MQTT compatible M

Jan 24, 2022

Using NFP (Number Format Parser) you can get an Abstract Syntax Tree (AST) from Excel number format expression

NFP (Number Format Parser) Using NFP (Number Format Parser) you can get an Abstract Syntax Tree (AST) from Excel number format expression. Installatio

Feb 4, 2022
periodic table on the command line
periodic table on the command line

element The periodic table on the command line Installation • Usage Installation Go get it! go get -u -v github.com/gennaro-tedesco/element Usage Usi

Dec 24, 2022
Data Structures in Go: Hash Table

Data Structures in Go: Hash Table he time has come to implement one of the most commonly used data structures in software development - the Hash Table

Oct 20, 2021
A tree like tool help you to explore data structures in your redis server
 A tree like tool help you to explore data structures in your redis server

Redis-view is a tree like tool help you explore data structures in your redis server

Mar 17, 2022
A faster method to get elements from an interface (Struct or Slice type) for Go.

A faster method to get elements from an interface (Struct or Slice type) for Go.

May 13, 2022
Convert arbitrary formats to Go Struct (including json, toml, yaml, etc.)

go2struct Convert arbitrary formats to Go Struct (including json, toml, yaml, etc.) Installation Run the following command under your project: go get

Nov 15, 2022
An interesting go struct tag expression syntax for field validation, etc.

An interesting go struct tag expression syntax for field validation, etc.

Jan 8, 2023
Convert json string to Golang struct

json-to-go-cli Convert json string to Golang struct How to install git clone https://github.com/tiancheng92/json-to-go-cli.git cd json-to-go-cli go bu

May 10, 2022
Python-like dictionaries for Go

Dict Python dictionary data type (dict) in Go Package dict is a Go implementation of Python dict, which are hashable object maps. Dictionaries complem

Nov 1, 2022
Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.

A Go package for calculating the Levenshtein distance between two strings This package implements distance and similarity metrics for strings, based o

Dec 15, 2022
An yet-another red-black tree implementation, with a C++ STL-like API.

A red-black tree with an API similar to C++ STL's. INSTALLATION go get github.com/yasushi-saito/rbtree EXAMPLE More examples can be fou

Apr 25, 2022