FAQ
Hello,

licenses uses go list tool over a Go workspace to collect the dependencies of a package or command, detect their license if any and match them against well-known templates. Get it here:

    https://github.com/pmezard/licenses

And assuming a configured Go workspace, use it like:

   $ licenses github.com/blevesearch/bleve
   github.com/blevesearch/bleve Apache License 2.0 (100%)
   github.com/blevesearch/go-porterstemmer MIT License (93%)
   github.com/blevesearch/segment Apache License 2.0 (100%)
   github.com/boltdb/bolt MIT License (97%)
   github.com/golang/protobuf/proto BSD 3-clause "New" or "Revised" License (91%)
   github.com/steveyen/gtreap MIT License (96%)

It started as a port of https://github.com/benbalter/licensee specialized for Go worspaces.
--
Patrick Mézard

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Fgergo at Oct 28, 2015 at 12:23 pm
    Really useful, thanks!
    You are maybe interested to consider:
    - to not print "(100%)" if there is a full match (for humans that's
    not really information)
    - to be able to analyze non-compiling packages, change licenses.go:183:
    args := []string{"list", "-json"}
    to:
    args := []string{"list", "-e", "-json"}

    On Wed, Oct 28, 2015 at 10:01 AM, Patrick Mézard wrote:
    Hello,

    licenses uses go list tool over a Go workspace to collect the dependencies of a package or command, detect their license if any and match them against well-known templates. Get it here:

    https://github.com/pmezard/licenses

    And assuming a configured Go workspace, use it like:

    $ licenses github.com/blevesearch/bleve
    github.com/blevesearch/bleve Apache License 2.0 (100%)
    github.com/blevesearch/go-porterstemmer MIT License (93%)
    github.com/blevesearch/segment Apache License 2.0 (100%)
    github.com/boltdb/bolt MIT License (97%)
    github.com/golang/protobuf/proto BSD 3-clause "New" or "Revised" License (91%)
    github.com/steveyen/gtreap MIT License (96%)

    It started as a port of https://github.com/benbalter/licensee specialized for Go worspaces.
    --
    Patrick Mézard

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Patrick Mézard at Oct 28, 2015 at 1:29 pm

    On 28/10/15 12:54, fgergo@gmail.com wrote:
    Really useful, thanks!
    You are maybe interested to consider:
    - to not print "(100%)" if there is a full match (for humans that's
    not really information)
    - to be able to analyze non-compiling packages, change licenses.go:183:
    args := []string{"list", "-json"}
    to:
    args := []string{"list", "-e", "-json"}
    Thank you for the suggestions. Both should be fixed.
    --
    Patrick Mézard

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Oct 28, 2015 at 3:04 pm
    Il giorno mercoledì 28 ottobre 2015 10:02:27 UTC+1, patrick ha scritto:
    Hello,

    licenses uses go list tool over a Go workspace to collect the dependencies
    of a package or command, detect their license if any and match them against
    well-known templates. Get it here:

    https://github.com/pmezard/licenses

    And assuming a configured Go workspace, use it like:

    $ licenses github.com/blevesearch/bleve
    Thanks for the package!
    Just a comment.

    Internally you use go list command, and this command supports special paths
    like "." and "...".
    When I use "." I want licenses to report me the licenses used by the
    external projects imported by the project in the current directory, but I
    get
    $ licenses .
                                                              [1]
    error: package information mismatch: asked for ., got
    github.com/pmezard/licenses

    When I use "..." I want licences to report me the licenses used by all the
    projects on my GOPATH (without recursing into imported external packages),
    but I get
    the plain output generated `go list -f <fmt>`.


    Regards Manlio

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Patrick Mézard at Oct 28, 2015 at 4:58 pm

    On 28/10/15 16:04, Manlio Perillo wrote:
    Il giorno mercoledì 28 ottobre 2015 10:02:27 UTC+1, patrick ha
    scritto:

    Hello,

    licenses uses go list tool over a Go workspace to collect the
    dependencies of a package or command, detect their license if any and
    match them against well-known templates. Get it here:

    https://github.com/pmezard/licenses
    <https://github.com/pmezard/licenses>

    And assuming a configured Go workspace, use it like:

    $ licenses github.com/blevesearch/bleve
    <http://github.com/blevesearch/bleve>


    Thanks for the package! Just a comment.

    Internally you use go list command, and this command supports special
    paths like "." and "...". When I use "." I want licenses to report me
    the licenses used by the external projects imported by the project in
    the current directory, but I get $ licenses .
    [1] error: package information mismatch: asked for ., got
    github.com/pmezard/licenses

    When I use "..." I want licences to report me the licenses used by
    all the projects on my GOPATH (without recursing into imported
    external packages), but I get the plain output generated `go list -f
    <fmt>`.
    Thanks for the feedback.
    licenses now understands package expression like "github.com/pmezard/..." or ".".

    I consider adding an option to control dependency retrieval, but I do not know yet if it should recurse by default or not.
    I feel the main case is to get all licenses for a given project, so you want recursion, but a negative option like -R/--no-recurse feels a bit weird.
    --
    Patrick Méard

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Oct 28, 2015 at 7:21 pm

    Il giorno mercoledì 28 ottobre 2015 17:58:43 UTC+1, patrick ha scritto:
    [...]
    When I use "..." I want licences to report me the licenses used by
    all the projects on my GOPATH (without recursing into imported
    external packages), but I get the plain output generated `go list -f
    <fmt>`.
    Thanks for the feedback.
    licenses now understands package expression like "github.com/pmezard/..."
    or ".".
    When using "..." , standard packages should be ignored.

    I consider adding an option to control dependency retrieval, but I do not
    know yet if it should recurse by default or not.
    I feel the main case is to get all licenses for a given project, so you
    want recursion, but a negative option like -R/--no-recurse feels a bit
    weird.
    As a very personal preference:
    `licenses pkg` or `licenses .` should iterate over all the imported
    packages of the specified project and report their licenses.
    It should not report the license of the specified package (and sub
    packages), since my use case would be to check the licenses of all external
    dependencies of one of my projects.
    However another use case is to check the license of a package with some
    commands...

    `licenses ...`, instead, should iterates over all package in the GOPATH and
    report their licenses (imported packages are ignored, of course).

    This is what licenses actually do, so IMHO there is no need for additional
    flags.
    By the way, I'm not sure to understand the -a flag.


    Thanks Manlio

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Patrick Mézard at Oct 29, 2015 at 8:19 am

    On 28/10/15 20:21, Manlio Perillo wrote:
    Il giorno mercoledì 28 ottobre 2015 17:58:43 UTC+1, patrick ha
    scritto:
    [...]
    When I use "..." I want licences to report me the licenses used by
    all the projects on my GOPATH (without recursing into imported
    external packages), but I get the plain output generated `go list
    -f <fmt>`.
    Thanks for the feedback. licenses now understands package expression
    like "github.com/pmezard/.. <http://github.com/pmezard/..>." or ".".


    When using "..." , standard packages should be ignored.
    Standard library packages are always ignored.

    [...]
    By the way, I'm not sure to understand the -a
    flag.
    If you have repository with a package and many subpackages used by the root one, like:

       /foo/sub1
           /sub2
           /sub3

    and only one LICENSE file in foo/, licenses only reports foo by default. With -a, it lists the subpackages as well.

    --
    Patrick Mézard

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Oct 30, 2015 at 9:08 am
    Il giorno giovedì 29 ottobre 2015 09:19:33 UTC+1, patrick ha scritto:
    On 28/10/15 20:21, Manlio Perillo wrote:
    [...]
    Thanks for the feedback. licenses now understands package expression
    like "github.com/pmezard/.. <http://github.com/pmezard/..>." or ".".


    When using "..." , standard packages should be ignored.
    Standard library packages are always ignored.
    http://pastebin.com/WDrLKwMT

    licenses should also ignore standard commands.
    [...]
    Thanks Manlio

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Patrick Mézard at Oct 30, 2015 at 12:59 pm

    On 30/10/15 10:08, Manlio Perillo wrote:
    Il giorno giovedì 29 ottobre 2015 09:19:33 UTC+1, patrick ha scritto:
    On 28/10/15 20:21, Manlio Perillo wrote:
    [...]
    Thanks for the feedback. licenses now understands package expression
    like "github.com/pmezard/ <http://github.com/pmezard/>.. <http://github.com/pmezard/..>." or ".".


    When using "..." , standard packages should be ignored.
    Standard library packages are always ignored.


    http://pastebin.com/WDrLKwMT

    licenses should also ignore standard commands.
    [...]
    Fixed, thanks.
    --
    Patrick Mézard

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 28, '15 at 9:02a
activeOct 30, '15 at 12:59p
posts9
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase