Releases: loov/goda
Module information for packages
It's now possible to use Module information, when available, for formatting labels.
As an example:
goda list -f "{{.ID}}{{with .Module.Version}}@{{.}}{{end}}" ./...:all
Fix "a b" and "a + b" difference
Fixes a bug with "goda graph alpha beta" being handled differently from "goda graph alpha + beta".
This release also includes an experimental "goda weight-diff binary1 binary2" to diff the symbol sizes between binaries. This command might be removed in the future.
`:test` and selector prefix `+-`
This release introduces new syntax for tests and shorthand for operations.
Selector prefix X:+S
is a shorthand for X + X:S
and X:-S
is a shorthand for X - X:S
.
// To select test packages (currently only within the current module)
X:test
// To select packages and including test packages:
X:+test
// To remove main packages:
X:-test
// To remove source packages (previously `X:nosource`):
X:-source
Breaking, rename :deps to :import
Currently :deps
is slightly ambiguous, instead use :import
that makes it clearer. For convenience there's a shorthand :imp
.
To select all dependencies you can use :import:all
.
Breaking change, default behavior is `:root`
- removes
:root
, this is the default behavior when specifying packages - removes
:noroot
, and replaces it with :deps - adds
:all
, to select all the dependencies - adds
:main
, to select main pacakges
When using the expression syntax, the first usage is often to target
all the roots and the dependencies... however most subtractions use
:root
.
Usage before:
goda graph X - golang.org/x/tools/...:root - github.com/xyz/...:root
Usage after:
goda graph X:all - golang.org/x/tools/... - github.com/xyz/...
New graph types and expressions
New expression:
incoming(X, Y)
- packages fromX
that directly import a package inY
New option for goda graph -type
flag:
tgf
- Trivial Graph Format, which is one of the simplest graph formats.graphml
- GraphML comprehensive format that can be used together with tools like yEd.digraph
- that can be used together with digraph tool.edges
- outputs each import edge on a separate line, can be useful grepping.
Label formatting has two new utility functions, which help to make the graph/list labels shorter:
{{ .ID | rel "github.com/loov/goda" }}
, uses relative names for packages starting with "github.com/loov/goda".{{ .ID | rename "github.com" "$gh" }}
, renames package path "github.com" with "$gh", as an example "github.com/loov/goda" would be renamed to "$gh/loov/goda".
Aligned list and cut output
v0.2.1 {cut,list}: add tab alignment
Simplified internals
The internal logic how stats was changed to allow for more flexible analysis. It's now possible to get stats about upstream and downstream packages.
This also means that some template functions were removed. They can be replaced as:
{{ LineCount . }}
->{{ .Go.Lines }}
{{ SourceSize . }}
->{{ .AllFiles.Size }}
{{ DeclCount . }}
->{{ .Decls }}
{{ TokenCount . }}
->{{ .Tokens }}