Ich möchte zu einem OSS-Projekt mit go
beitragen, aber ich habe es schwer, es zu kompilieren. Es sieht so aus, als ob ich etwas Offensichtliches vermisse.Kann kein Open-Source-Projekt erstellen
Ich denke, das Problem hängt damit zusammen, wie go
auf meinem Computer installiert ist, und nicht auf das Projekt selbst, also poste ich es hier auf StackOverflow, anstatt Projekt "Issues" Abschnitt.
Unten ist was ich mache.
Ich habe
go
homebrew
mit installiert:$ brew install go Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae libebml ==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.tar.gz Already downloaded: /Users/gmile/Library/Caches/Homebrew/go-1.8.3.sierra.bottle.tar.gz ==> Pouring go-1.8.3.sierra.bottle.tar.gz ==> Caveats A valid GOPATH is required to use the `go get` command. If $GOPATH is not specified, $HOME/go will be used by default: https://golang.org/doc/code.html#GOPATH You may wish to add the GOROOT-based install location to your PATH: export PATH=$PATH:/usr/local/opt/go/libexec/bin ==> Summary /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB $
Dann geklont ich den Repo:
$ hub clone lucapette/fakedata
I
make setup
lief (pro Befehl), die zunächst nicht tat erfolgreich abschließen:dachte ich, das ist, weil
gometalinter
nirgends in meinem$PATH
ist, so haben sie hinzugefügt (Ich verwende fish-shell):$ set fish_user_paths /Users/gmile/go/bin
laufen
make setup
nun gelungen zu sein scheinen. Dies ist die Ausgabe:$ make setup go get -u github.com/alecthomas/gometalinter gometalinter --install Installing: aligncheck deadcode dupl errcheck gas goconst gocyclo goimports golint gosimple gotype ineffassign interfacer lll megacheck misspell safesql staticcheck structcheck unconvert unparam unused varcheck $
make build
schlägt fehl:$ make build go build main.go:11:2: cannot find package"github.com/lucapette/fakedata/pkg/fakedata" in any of: /usr/local/Cellar/go/1.8.3/libexec/src/github.com/lucapette/fakedata/pkg/fakedata (from $GOROOT) /Users/gmile/go/src/github.com/lucapette/fakedata/pkg/fakedata (from $GOPATH) main.go:12:2: cannot find package "github.com/spf13/pflag" in any of: /usr/local/Cellar/go/1.8.3/libexec/src/github.com/spf13/pflag (from $GOROOT) /Users/gmile/go/src/github.com/spf13/pflag (from $GOPATH) make: *** [build] Error 1 $
Also entweder Contributing Richtlinie unvollständig ist, oder ich bin fehlt etwas offensichtlich über die Installation und Go-Pakete verwalten.
Vielen Dank! Das hat geholfen. – gmile