gostruct

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 2 Imported by: 0

README

gostruct

This is an open source tool convert mysql table structure to golang`s struct and written by pure golang. If you want to get a beautiful struct, make sure the gofmt has been installed and in the $PATH.

Install:

go get github.com/CaiJinKen/gostruct

Usage:

  • get struct from sql file
gostruct -i users.sql -o users.go
  • get struct from db connection
gostruct -d `user:password@tcp(host:port)/db_name` -t users -o ./models/users.go

This tool also can:

  • generate json tag(default) and gorm tag
  • print the struct(default)
  • sort struct fields

Help:

gostruct --help

or

gostruct -h

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