FAQ
Hello,

so I created a small library (simple implementation of 2-gram string
similarity) and I published it (https://github.com/lzap/stringsim). I have
a program that use it using import "stringsim/adjpair" and since I have
installed in my $GO/src directory structure correctly and installed with go
install, it imports and works fine.

Now I would like to change the import in my program to this format:

import "github.com/lzap/stringsim/adjpair"

and for this, I assume, I need to install the package first (if this is the
right approach). Unfortunately:

$ go get github.com/lzap/stringsim
package github.com/lzap/stringsim
imports github.com/lzap/stringsim
imports github.com/lzap/stringsim: no Go source files in
/home/lzap/work/go/src/github.com/lzap/stringsim

Second question is - how do I update a package installed using "go get"?
And how to do this fluently when I will work both on library and on my
program that use it? What is the best strategy in this case?

Thanks

--

Search Discussions

  • Kyle Lemons at Dec 6, 2012 at 8:55 pm
    I usually clone them myself in $GOPATH if they're mine, but you can go get
    them and then "git add remote" to add your favorite https/ssh read|write
    URL. The "git push" command has an option (-u, I think) that will set it
    as the default upstream, and then you're all set. You also use the second
    option if you fork it and want to work within the original import path so
    you can push it upstream with minimum of effort.

    On Thu, Dec 6, 2012 at 3:07 PM, Lukáš Zapletal wrote:

    Hello,

    so I created a small library (simple implementation of 2-gram string
    similarity) and I published it (https://github.com/lzap/stringsim). I
    have a program that use it using import "stringsim/adjpair" and since I
    have installed in my $GO/src directory structure correctly and installed
    with go install, it imports and works fine.

    Now I would like to change the import in my program to this format:

    import "github.com/lzap/stringsim/adjpair"

    and for this, I assume, I need to install the package first (if this is
    the right approach). Unfortunately:

    $ go get github.com/lzap/stringsim
    package github.com/lzap/stringsim
    imports github.com/lzap/stringsim
    imports github.com/lzap/stringsim: no Go source files in
    /home/lzap/work/go/src/github.com/lzap/stringsim

    Second question is - how do I update a package installed using "go get"?
    And how to do this fluently when I will work both on library and on my
    program that use it? What is the best strategy in this case?

    Thanks

    --

    --
  • Jesse McNelis at Dec 7, 2012 at 5:16 am

    On Fri, Dec 7, 2012 at 7:07 AM, Lukáš Zapletal wrote:

    $ go get github.com/lzap/stringsim
    package github.com/lzap/stringsim
    imports github.com/lzap/stringsim
    imports github.com/lzap/stringsim: no Go source files in
    /home/lzap/work/go/src/github.com/lzap/stringsim
    Your package is at "github.com/lzap/stringsim/adjpair" so that's what you
    need to 'go get'
    eg. go get github.com/lzap/stringsim/adjpair

    Second question is - how do I update a package installed using "go get"?
    And how to do this fluently when I will work both on library and on my
    program that use it? What is the best strategy in this case?
    To fetch the lastest version of your package just run:
    go get -u github.com/lzap/stringsim/adjpair

    --
    =====================
    http://jessta.id.au

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 6, '12 at 8:07p
activeDec 7, '12 at 5:16a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase