warthog618 / gpio

A native Go library for Raspberry Pi GPIO
MIT License
123 stars 9 forks source link

too many GO modules depends #3

Closed gallex closed 4 years ago

gallex commented 4 years ago

I found it depends on soo many modules which I can't download all, and I can't get it compiled.

after remove file go.mod, go.sum, fallback to go get mode, it compile OK.

maybe somethin error whit go module ?

BTW: I very this project : wonderful function, clear APIs ...

warthog618 commented 4 years ago

It works for me without problem with a bare checkout on a bare VM and built with Go 1.13. So you will need to provide more information as to your environment and what you are seeing.

gallex commented 4 years ago

I use Raspbian Buster with offical Go 1.11.6.

output message like this :

go: finding github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 go: finding github.com/stretchr/objx v0.1.0 go: finding github.com/coreos/etcd v3.3.15+incompatible go: google.golang.org/appengine@v1.4.0: unrecognized import path "google.golang.org/appengine" (https fetch: Get https://google.golang.org/appengine?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/sys@v0.0.0-20190825160603-fb81701db80f: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: google.golang.org/grpc@v1.23.0: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/crypto@v0.0.0-20190820162420-60c769a6c586: unrecognized import path "golang.org/x/crypto" (https fetch: Get https://golang.org/x/crypto?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/time@v0.0.0-20190308202827-9d24e82272b4: unrecognized import path "golang.org/x/time" (https fetch: Get https://golang.org/x/time?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: finding github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 go: golang.org/x/text@v0.3.2: unrecognized import path "golang.org/x/text" (https fetch: Get https://golang.org/x/text?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.1 go: finding github.com/golang/protobuf v1.2.0 go: sigs.k8s.io/yaml@v1.1.0: unrecognized import path "sigs.k8s.io/yaml" (https fetch: Get https://sigs.k8s.io/yaml?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: finding github.com/stretchr/objx v0.1.1 go: finding github.com/kisielk/errcheck v1.1.0 go: google.golang.org/grpc@v1.19.0: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: go.etcd.io/bbolt@v1.3.3: unrecognized import path "go.etcd.io/bbolt" (https fetch: Get https://go.etcd.io/bbolt?go-get=1: dial tcp: lookup go.etcd.io on 114.114.114.114:53: read udp 192.168.1.110:34601->114.114.114.114:53: i/o timeout) go: golang.org/x/sys@v0.0.0-20181107165924-66b7b1311ac8: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: golang.org/x/sys@v0.0.0-20190422165155-953cdadca894: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) go: finding github.com/ghodss/yaml v1.0.0 go: finding github.com/stretchr/testify v1.2.2

gallex commented 4 years ago

I think : require github.com/warthog618/config v0.2.0 maybe error

warthog618 commented 4 years ago

No, the config dependency is there for the examples. That will be pulling in other dependencies and you seem to have a problem in there somewhere (which I don't get - I can go build in a fresh checkout on Raspbian Buster using the included Go 1.11 - it just downloads a lot - as you say).

Try upgrading to Go 1.13- that only seems to download what the build actually needs rather than everything a full build might need. And if you don't build the examples you should be fine.

gallex commented 4 years ago

For me and other guys from china, download from google is a big problem (-; , so we hope download as little as possible.

as GO1.11 has error, GO1.1.3 is too new, my suggestion is do not use module now .

gallex commented 4 years ago

Yes, as I tested, import it from other program is OK if the program don't use module, But it would error too if the main program use module.

warthog618 commented 4 years ago

Your problem with modules is a problem with your environment, not the fact that this library uses modules. Best of luck sorting that out.