Giter VIP home page Giter VIP logo

Comments (6)

NHOrus avatar NHOrus commented on July 16, 2024

Note: currently it could be added by manually installing and then passing following additional argument to metalinter:

--linter='maligned:maligned .:PATH:LINE:COL:MESSAGE' --severity=maligned:warning

Where maligned points to end of the struct, aligncheck points to start of struct, based on examples

from gometalinter.

alecthomas avatar alecthomas commented on July 16, 2024

Do you have an example of where it is more precise, because it seems to be producing less information for me:

$ maligned cmd/compile/internal/gc cmd/link/internal/ld
/usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/esc.go:395:15: struct of size 232 could be 224
/usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/go.go:135:10: struct of size 120 could be 112
/usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/go.go:155:11: struct of size 224 could be 216
/usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/ldelf.go:267:13: struct of size 208 could be 200
/usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/ldpe.go:117:12: struct of size 144 could be 136
/usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/link.go:123:11: struct of size 256 could be 240
/usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/link.go:40:11: struct of size 296 could be 288
$ aligncheck cmd/compile/internal/gc cmd/link/internal/ld
cmd/compile/internal/gc: /usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/esc.go:395:6: struct EscState could have size 224 (currently 232)
cmd/compile/internal/gc: /usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/go.go:135:6: struct Sym could have size 112 (currently 120)
cmd/compile/internal/gc: /usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/go.go:155:6: struct Type could have size 216 (currently 224)
cmd/compile/internal/gc: /usr/local/Cellar/go/1.5/libexec/src/cmd/compile/internal/gc/go.go:80:6: struct Mpcplx could have size 72 (currently 80)
cmd/link/internal/ld: /usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/ldelf.go:267:6: struct ElfObj could have size 200 (currently 208)
cmd/link/internal/ld: /usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/ldpe.go:117:6: struct PeObj could have size 136 (currently 144)
cmd/link/internal/ld: /usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/link.go:123:6: struct Link could have size 240 (currently 256)
cmd/link/internal/ld: /usr/local/Cellar/go/1.5/libexec/src/cmd/link/internal/ld/link.go:40:6: struct LSym could have size 288 (currently 296)

from gometalinter.

sztanpet avatar sztanpet commented on July 16, 2024

yes, see the link to the go issue which is admittedly an edgecase

from gometalinter.

sztanpet avatar sztanpet commented on July 16, 2024

oh you mean for the same thing it provides more info, nevermind, cant read

from gometalinter.

alecthomas avatar alecthomas commented on July 16, 2024

Exactly, yes.

Both of these tools are quite slow and CPU intensive due to their nature, so I'd prefer to only integrate one. I have no preference which beyond "the best", but so far it seems that aligncheck produces better results?

from gometalinter.

sztanpet avatar sztanpet commented on July 16, 2024

sure, my mistake then, I thought it didn't cover the edgecase of a struct{} being the last member

from gometalinter.

Related Issues (20)

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.