Hi, Manlio.

I like your idea of putting the reusable code in a separate Git repository, and 
then vendoring it into the application project.  That makes a lot of sense.  I 
hadn't thought of that.  Thanks for the idea.

I also like the idea of making it an internal package, and move it to a 
separate repository once it is stable.  My first Go code, and my first 
architecture for the program, was not very good, but as I learn Go, I'm 
learning ways to improve it.  In my first version, I had way too many package 
dependencies.  I kept hitting the cyclic dependency compiler error.  I finally 
decided that, instead of dealing with the dependency problems one at a time, I 
needed to rearchitect the program.  So, I am doing that now.  Ugh.  Oh well, my 
second version will be a real improvement over the first version.  :-)

Thanks for the pointer about "gb vendor help fetch".  That is exactly what I 
needed to know!  I just started to use gb a couple of days ago, so I'm a newbie 
with that too.

Thank you for your help.  Much appreciated.

Jeff Kayser
Jibe Consulting | Managing Principal Consultant
5000 Meadows Rd. Suite 300
Lake Oswego, OR 97035
O: 503-517-3266 | C: 503.901.5021
jeff.kay...@jibeconsulting.com


-----Original Message-----
From: Manlio Perillo [mailto:manlio.peri...@gmail.com] 
Sent: Sunday, February 05, 2017 3:55 PM
To: Jeff Kayser <jeff.kay...@jibeconsulting.com>
Cc: golang-nuts <golang-nuts@googlegroups.com>; jeffkays...@gmail.com
Subject: Re: Go package/version management, vendoring, dep, gb, etc...

On Sun, Feb 5, 2017 at 11:39 PM, Jeff Kayser <jeff.kay...@jibeconsulting.com> 
wrote:
> Hi, Manlio.
>
> Thank you for your reply!
>
> The project is an application, however, I’m planning to write the 
> underlying components so they are reusable, so they can be leveraged 
> elsewhere.  Since I will be using the packages to build an app, I need 
> to make sure the builds are reproducible.  ☺
>

In this case move them to a separate package/project.
As an example, create a git repository in $GOPATH/src/github.com/$USER/project/

Use this git repository for the main development, and tag your versions with 
tags and branches.

Then in your application, clone the repository in vendor/src/github.com/$USER

In this case you have full control over the version used, and you can also 
modify the code and pull/push changes to the original repository.
For your first project, probably all the development will be in the cloned 
repository, and you will push the changes to the original repository once the 
code is stable and needs to be used by other projects.

Another solution is to put the reusable components in an internal package (of 
your application), and once you like the code you move it to a new project.
I like this one, because it will allow you to start with a draft.

> I had a very helpful email exchange with Dave Cheney, and he suggested gb + 
> semver.  With the current lack of convergence on go package 
> versioning/dependency management, it seems wise to me to follow his 
> recommendation, since he is one of the Go gurus.
>
> Hey, go+ is a cool script!  Thanks for sharing!
>
> I’m finding out (the hard way) how to deal with cyclic dependencies, so 
> package management has become really important to me.
>

Go does not support cyclic dependencies, and I don't see how package management 
is related to cyclic dependencies.

> Question: is it possible for gb to vendor a specific version of a package?

Yes.
It is specified in the documentation
    gb vendor help fetch

You can specify a tag, branch or exact revision.

> [...]

Manlio

Disclaimer: This electronic message may contain information that is 
Confidential or legally privileged. It is intended only for the use of the 
individual(s) and entity named in the message. If you are not an intended 
recipient of this message, please notify the sender immediately and delete the 
material from your computer. Do not deliver, distribute or copy this message 
and do not disclose its contents or take any action in reliance on the 
information it contains.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to