Categorygithub.com/AlexanderMint/structsorter
modulepackage
0.0.0-20240112132658-d2990deb0a66
Repository: https://github.com/alexandermint/structsorter.git
Documentation: pkg.go.dev

# README

Fork: fieldalignment

Added sorting of fields in alphabetical order when the size of the fields is the same

Install

go install github.com/AlexanderMint/structsorter/cmd/structsorter

Example

// test/in_file.go
type A struct {
	cc *int
	b  string
	i  int
	a  string
	z  int64
	aa bool
	c  string
	bb *int
}
structsorter --fix ./test/in_file.go

result:

type A struct {
    bb *int
    cc *int
    a  string
    b  string
    c  string
    i  int
    z  int64
    aa bool
}

# Packages

No description provided by the author

# Constants

No description provided by the author

# Variables

No description provided by the author