tormoder/fit

"use of internal package not allowed" after clone

Closed this issue · 4 comments

To make it easier to contribute we should probably find a way to get rid of "use of internal package not allowed" - error messages after clone. Currently I need to sed s/tormoder/torgil/g all code.

Example:
"../../go/src/github.com/torgil/fit/reader.go:14:2: use of internal package not allowed"

changing the line "github.com/tormoder/fit/internal/types" to "github.com/torgil/fit/internal/types" removes the error for me but clutters the workspace and will make for constant merge-confilcts in every pull/rebase-iteration.

Hi!

The way to work with Go projects and PRs is to clone this repository to
$GOPATH/src/tormoder/fit locally
and do your changes there, but also fork the repository on GitHub to your user, e.g.
http://github.com/torgil/fit
but use that repo as a git remote to the local repo, and use that remote to submit pull requests.

Also see for example http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html.

When using this approach you won't have any problem with internal packages.

(I guess this should be explained in the readme...)

You are saying that its okay for fitgen/internal to use top folder internal. Fair enough.

Sorry for the basics, I'm new to go. I'm still not entirely satisfied as this means that applications requiring my fork will not work unless my changes gets merged in to your repository. Must I then keep two branches (one for publish and one for pushing upstream)?
What is the preferred solution for this?

No problem, this is a quirk for Go and pull requests.

Using your own repository to only submit PRs works ok (one branch per PR), but also using it for developing (i.e. a master branch) and maintaining your own fork is more difficult. You basically have to rename the imports you mentioned, but that will conflict with upstream.

Me using the fork for development is not a problem. I'm thinking how to make it seamless for someone other than me to use a program needing the fork.

$ GOPATH=.   # not the regular place as it'll interfere with other software that might need original fit package
$ go get github.com/tormoder/fit
$ (cd $GOPATH/src/github.com/tormoder/fit && git fetch https://github.com/torgil/fit.git --depth=1 && git checkout FETCH_HEAD)
$ GOBIN=. go install app.go
$ ./app

It'll take a while before I get there though. And it's more a general problem than a tormoder/fit - problem.