--
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Next question: how exactly are library developers supposed to layout
their source code in source control, and what is the intended mapping
of package to DVCS repository? I haven't found a clear documented
guideline anywhere, so there seem to be a couple of conventions.
1) dump *.go right in the repository root, which is messy and makes it
hard to have sibling packages in the same repo ... but it works
nicely with "go get" and "go install"
2) have a subdirectory for each package:
pkg1/*.go
pkg2/*.go
...
pkgN/*.go
which is tidy, scales nicely, and should allow both sibling and
child packages. But making "go install" understand that is confusing.
I *think* you have to run "go install ./...", but that's unclear and
not mentioned in http://golang.org/doc/code.html.
3) duplicate the "workspace" structure in source control:
src/pkg1/*.go
src/pkg2/*.go
which means I can "git clone" your repo and get right to work,
but it means that apps using your library will have painfully
long import paths, e.g.
import "github.com/sbinet/go-python/pkg/python"
I'm pretty sure this is wrong for libraries, but it makes sense for
applications that are targeted at users rather than other Go
programmers. (At any rate, that's how I've structure my application,
and it seems to work.)
Final question: same as above, but how are *application* developers
supposed to layout their source code?
One more thought on go get. Maybe you're used to examining projects before you build them, to check for security issues in the makefiles. But go get doesn't use makefiles or shell scripts, so it doesn't execute any code from the project you're downloading; it only compiles it. So it should be safe to do something like go get github.com/l33th4ck0r/myNefariousTrojan/...; just don't run the executables it produces :-).
--
Greg,
This may be a Ubuntu issue (the Travis ci not for go-python shows the same behavior)
-s
Sent from my droid.
On Wed, Feb 6, 2013 at 10:43 PM, Job van der Zwan
<j.l.van...@gmail.com> wrote:
> Since we're on the topic of go get/install, I also have a small issue: on my
> new laptop it no longer automatically fetches the dependencies of a package
> - when I tried "go get github.com/skelterjohn/go.wde", I had manually go get
> the packages imported by go.wde. I thought it used to do that automatically?
> I'm running tip, in case that matters.
No problem here:
jnml@fsc-r630:~$ go get -v github.com/skelterjohn/go.wde
github.com/skelterjohn/go.wde (download)
github.com/skelterjohn/go.wde
jnml@fsc-r630:~$ go version
go version devel +aee6d7fe395a Sat Jan 26 18:16:43 2013 -0800 linux/amd64
jnml@fsc-r630:~$
import ("fmt""image""sync")
Go get doesn't care about repositories per se(*), but about packages
you name in the command argument.
-j
(*) It downloads the repo where the requested package is located, but
it _doesn't_ install automagically every (other) package which the
repo may contain. Which is a Good Thing (tm).
2009-present (Go only?)
- "go get" the repo
- figure out how to build+test the damn thing
(progress! this is usually trivial)
- hack on it and send pull requests (or email patches)
I wonder where do you see that go.wde imports xgb?
On Thursday, 7 February 2013 06:23:20 UTC+11, Greg Ward wrote:$ go install
go install: no install location for _/tmp/testify
I had the same problem with "go install", GOBIN needs to be set for "go install" to work correctly.Check with "go env".It should be set to your GOPATH + /bin
Hi all --
I've been holding back on this, on the assumption that I'm just a
newbie and I don't get it. Well, no more! I've paid my dues, I've
written my first 10,000 lines of Go, and I am still *utterly
mystified* by how go {get,install} want us to organize our packages
(where "us" means "the Go community").
Yes, I have read http://golang.org/doc/code.html. Many times.
Backwards and forwards. I *must* be missing something.
First question: if I want to checkout someone else's code to
contribute changes, *not* to use it in my own project, am I supposed
to "{git,hg} clone" it or "go get" it? I find that very few Go
packages are in a state where I can just clone them and build them.
Examples, picking on some of the packages that my project depends
on...
$ git clone http://github.com/stretchrcom/testify
Cloning into 'testify'...
[...]
$ cd testify
$ go install
go install: no install location for _/tmp/testify
$ go install .
go install: no install location for _/tmp/testify
$ GOPATH=$PWD go install
go install: no install location for _/tmp/testify
$ GOPATH=$PWD go install .
go install: no install location for _/tmp/testify
$ GOPATH=/tmp/go go install
go install: no install location for _/tmp/testify
$ GOPATH=/tmp/go go install .
go install: no install location for _/tmp/testify
Argh, give up in frustration. Guess I won't be contributing to this
project. Try another one:
$ git clone http://github.com/ogier/pflag
Cloning into 'pflag'...
[...]
$ go install
So, by default, go get retrieves the latest version of any repo. So you can't really have a package working from an older version. However, you can if you just fork the older version at a specific commit and have your code working against the fork.So for example, if github.com/foo/libA has the latest code, you import against that for P1, which wants to work against latest. And fork the older commit version to github.com/Eric/libA, and use that to work with P2.
If you need to be absolutely sure you're working against a frozen codebase, you need to have control over the repo you're importing, thus the forking.In theory, every Go developer should make sure they don't make breaking API changes in the same repo, until the Go Team can figure out how they want versioning to work.... but obviously not everyone is going to do that.
Yes, I've been scanning the http://go-lang.cat-v.org/pure-go-libs list, and thried to go get a randomly-pick 20-subset, and I've succeeded for almost only 2 or 3. (by the time I also required that the code were licensed (any license was ok, but I needed at least one).
Yes, I've been scanning the http://go-lang.cat-v.org/pure-go-libs list, and thried to go get a randomly-pick 20-subset, and I've succeeded for almost only 2 or 3. (by the time I also required that the code were licensed (any license was ok, but I needed at least one).