GithubHelp home page GithubHelp logo

tranquoctoan1996 / aligo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from essentialkaos/aligo

0.0 0.0 0.0 183 KB

Utility for checking and viewing Golang struct alignment info

Home Page: https://kaos.sh/aligo

License: Apache License 2.0

Go 92.18% Makefile 7.82%

aligo's Introduction

GitHub Actions CI Status GoReportCard codebeat badge GitHub Actions CodeQL Status

ScreenshotsInstallationCommand-line completionMan documentationFAQUsageBuild StatusContributingThanksLicense


aligo is a utility for checking and viewing Golang struct alignment info.

Screenshots

aligo preview aligo preview

Installation

From source

To build the aligo from scratch, make sure you have a working Go 1.17+ workspace (instructions), then:

go install github.com/essentialkaos/aligo

Command-line completion

You can generate completion for bash, zsh or fish shell.

Bash:

sudo aligo --completion=bash 1> /etc/bash_completion.d/aligo

ZSH:

sudo aligo --completion=zsh 1> /usr/share/zsh/site-functions/aligo

Fish:

sudo aligo --completion=fish 1> /usr/share/fish/vendor_completions.d/aligo.fish

Man documentation

You can generate man page for aligo using next command:

aligo --generate-man | sudo gzip > /usr/share/man/man1/aligo.1.gz

FAQ

Q: I think my struct is well aligned. How can I disable check for it?

A: You could add a comment with text aligo:ignore for this struct, and aligo will ignore all problems with it. Example:

// This is my supa-dupa struct
// aligo:ignore
type MyStruct struct {
  A bool
  B int
}

Usage

Usage: aligo {options} {command} package…

Commands

  check    Check package for alignment problems
  view     Print alignment info for all structs

Options

  --arch, -a name      Architecture name
  --struct, -s name    Print info only about struct with given name
  --tags, -t tag…      Build tags (mergeble)
  --no-color, -nc      Disable colors in output
  --help, -h           Show this help message
  --version, -v        Show version

Examples

  aligo view .
  Show info about all structs in current package

  aligo check .
  Check current package

  aligo check ./...
  Check current package and all sub-packages

  aligo --tags tag1,tag2,tag3 check ./...
  Check current package and all sub-packages with custom build tags

  aligo -s PostMessageParameters view .
  Show info about PostMessageParameters struct

Build Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

Thanks

We would like to thank:

License

Apache License, Version 2.0

aligo's People

Contributors

andyone avatar dependabot[bot] avatar zeripath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.