Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javiercbk/impack
Imperfect memory packer for Go
https://github.com/javiercbk/impack
Last synced: about 2 months ago
JSON representation
Imperfect memory packer for Go
- Host: GitHub
- URL: https://github.com/javiercbk/impack
- Owner: javiercbk
- License: unlicense
- Created: 2021-02-17T01:54:19.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T18:45:40.000Z (over 1 year ago)
- Last Synced: 2024-06-20T13:31:46.394Z (7 months ago)
- Language: Go
- Size: 20.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Impack
Imperfect memory packer for Go
## Features
`impack` will grab every struct in a package and order the fields by lower size to higher size. When sizes match it will order alphabetically.
This is an imperfect memory packer since it does not maximize memory efficiency by packing structs perfectly, it attempts to minimize memory footprint but trying to remain as human readable as possible.
## Install
```sh
go install github.com/javiercbk/impack/cmd/impack@latest
```## Usage
`impack` will lint a whole package, and re-order every struct's fields in the package.
```sh
impack --compiler gc --arch amd64 /home/user/path/to/go/package/folder1 /home/user/path/to/go/package/folder2
```* The first unnammed parameter will be considered as the package path. By default it will be the current folder
* `--compiler` defaults to `gc`. Affects the size and the alignment values of types.
* `--arch` defaults to `amd64`. Also affects the size and the alignment values of types.