Microservices with go-kit. Part 1

Alex Pliutau on July 30, 2018

This is a text version of the "packagemain #12: Microservices with go-kit. Part 1" video. Part 2 Nowadays, Microservices is one of the most... [Read Full]
markdown guide
 

Hi Alex. I am newbie to GoKit. When i run "go get github.com/go-kit/kit", it gets the packages but returns an error "no Go files in /Users/username/go/src/github.com/go-kit/kit" and even after i install gokit CLI. i get the kit command not found issue. Can you help me out here a bit

 
  1. go-kit is a collection of packages, so you should get specific one, like: go get github.com/go-kit/kit/sd, or all packages: go get github.com/go-kit/kit/....
  2. When you install CLI by go get github.com/kujtimiihoxha/kit it installs into $GOPATH/bin, so you should add it to your system $PATH variable.
 

I have the $GOPATH/bin added to my $PATH variable but still facing the Kit command not found issue. I have pasted below the output of my echo $PATH.

/usr/local/opt/node@8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/nikhil/Library/Android/sdk/tools:/Users/nikhil/Library/Android/sdk/tools/bin:/Users/nikhil/Library/Android/sdk/platform-tools:/usr/local/opt/go/libexec/bin

Can you please share how do you install Go Kit CLI?

Exactly like you mentioned
Go Kit CLI: go get github.com/kujtimiihoxha/kit

Then inside my project directory
And i used glide to install GoKit: glide get github.com/go-kit/kit

My $GOPATH is set to /usr/local/go/bin
My Project is on /Users/username/go/src/project

  1. You should set GOPATH=/Users/username/go
  2. After go get github.com/kujtimiihoxha/kit you can find kit in $GOPATH/bin/kit

Hey
I got it running. Thanks a ton Alex :)
Keep you the great work. Looking forward to more Go tutorials.

 

i have followed your tutorial step by step and i got these following error while executing docker-compose up:

....
github.com/opentracing/basictracer-go (download)
src/github.com/apache/thrift/lib/go/test/tests/protocol_mock.go:29:2: cannot find package "github.com/golang/mock/gomock" in any of:
/usr/local/go/src/github.com/golang/mock/gomock (from $GOROOT)
/go/src/github.com/golang/mock/gomock (from $GOPATH)
src/github.com/apache/thrift/lib/go/test/tests/protocol_mock.go:27:2: cannot find package "thrift" in any of:
/usr/local/go/src/thrift (from $GOROOT)
/go/src/thrift (from $GOPATH)
src/github.com/apache/thrift/lib/go/test/tests/thrifttest_driver.go:25:2: cannot find package "thrifttest" in any of:
/usr/local/go/src/thrifttest (from $GOROOT)
/go/src/thrifttest (from $GOPATH)
src/github.com/apache/thrift/test/go/src/bin/stress/main.go:26:2: cannot find package "gen/stress" in any of:
/usr/local/go/src/gen/stress (from $GOROOT)
/go/src/gen/stress (from $GOPATH)
src/github.com/apache/thrift/test/go/src/bin/testclient/main.go:23:2: cannot find package "common" in any of:
/usr/local/go/src/common (from $GOROOT)
/go/src/common (from $GOPATH)
src/github.com/apache/thrift/test/go/src/bin/testclient/main.go:26:2: cannot find package "gen/thrifttest" in any of:
/usr/local/go/src/gen/thrifttest (from $GOROOT)
/go/src/gen/thrifttest (from $GOPATH)
src/github.com/apache/thrift/tutorial/go/src/handler.go:25:2: cannot find package "shared" in any of:
/usr/local/go/src/shared (from $GOROOT)
/go/src/shared (from $GOPATH)
src/github.com/apache/thrift/tutorial/go/src/client.go:26:2: cannot find package "tutorial" in any of:
/usr/local/go/src/tutorial (from $GOROOT)
/go/src/tutorial (from $GOPATH)
src/github.com/go-kit/kit/auth/casbin/middleware.go:7:2: cannot find package "github.com/casbin/casbin" in any of:
/usr/local/go/src/github.com/casbin/casbin (from $GOROOT)
/go/src/github.com/casbin/casbin (from $GOPATH)
src/github.com/go-kit/kit/auth/jwt/middleware.go:7:2: cannot find package "github.com/dgrijalva/jwt-go" in any of:
/usr/local/go/src/github.com/dgrijalva/jwt-go (from $GOROOT)
/go/src/github.com/dgrijalva/jwt-go (from $GOPATH)
src/github.com/go-kit/kit/circuitbreaker/hystrix.go:6:2: cannot find package "github.com/afex/hystrix-go/hystrix" in any of:
/usr/local/go/src/github.com/afex/hystrix-go/hystrix (from $GOROOT)
/go/src/github.com/afex/hystrix-go/hystrix (from $GOPATH)
src/github.com/go-kit/kit/circuitbreaker/gobreaker.go:6:2: cannot find package "github.com/sony/gobreaker" in any of:
/usr/local/go/src/github.com/sony/gobreaker (from $GOROOT)
/go/src/github.com/sony/gobreaker (from $GOPATH)
src/github.com/go-kit/kit/circuitbreaker/handy_breaker.go:7:2: cannot find package "github.com/streadway/handy/breaker" in any of:
/usr/local/go/src/github.com/streadway/handy/breaker (from $GOROOT)
/go/src/github.com/streadway/handy/breaker (from $GOPATH)
src/github.com/go-kit/kit/cmd/kitgen/main.go:14:2: cannot find package "github.com/pkg/errors" in any of:
/usr/local/go/src/github.com/pkg/errors (from $GOROOT)
/go/src/github.com/pkg/errors (from $GOPATH)
src/github.com/go-kit/kit/cmd/kitgen/ast_templates.go:7:8: cannot find package "golang.org/x/tools/godoc/vfs/mapfs" in any of:
/usr/local/go/src/golang.org/x/tools/godoc/vfs/mapfs (from $GOROOT)
/go/src/golang.org/x/tools/godoc/vfs/mapfs (from $GOPATH)
src/github.com/go-kit/kit/cmd/kitgen/transform.go:18:2: cannot find package "golang.org/x/tools/imports" in any of:
/usr/local/go/src/golang.org/x/tools/imports (from $GOROOT)
/go/src/golang.org/x/tools/imports (from $GOPATH)
src/github.com/go-kit/kit/tracing/zipkin/endpoint.go:6:2: cannot find package "github.com/openzipkin/zipkin-go" in any of:
/usr/local/go/src/github.com/openzipkin/zipkin-go (from $GOROOT)
/go/src/github.com/openzipkin/zipkin-go (from $GOPATH)
src/github.com/go-kit/kit/tracing/zipkin/endpoint.go:7:2: cannot find package "github.com/openzipkin/zipkin-go/model" in any of:
/usr/local/go/src/github.com/openzipkin/zipkin-go/model (from $GOROOT)
/go/src/github.com/openzipkin/zipkin-go/model (from $GOPATH)
src/github.com/go-kit/kit/tracing/zipkin/grpc.go:9:2: cannot find package "github.com/openzipkin/zipkin-go/propagation/b3" in any of:
/usr/local/go/src/github.com/openzipkin/zipkin-go/propagation/b3 (from $GOROOT)
/go/src/github.com/openzipkin/zipkin-go/propagation/b3 (from $GOPATH)
src/github.com/go-kit/kit/examples/addsvc/cmd/addcli/addcli.go:19:2: cannot find package "github.com/openzipkin/zipkin-go/reporter/http" in any of:
/usr/local/go/src/github.com/openzipkin/zipkin-go/reporter/http (from $GOROOT)
/go/src/github.com/openzipkin/zipkin-go/reporter/http (from $GOPATH)
src/github.com/go-kit/kit/examples/addsvc/pkg/addendpoint/set.go:7:2: cannot find package "golang.org/x/time/rate" in any of:
/usr/local/go/src/golang.org/x/time/rate (from $GOROOT)
/go/src/golang.org/x/time/rate (from $GOPATH)
src/github.com/go-kit/kit/examples/apigateway/main.go:20:2: cannot find package "github.com/gorilla/mux" in any of:
/usr/local/go/src/github.com/gorilla/mux (from $GOROOT)
/go/src/github.com/gorilla/mux (from $GOPATH)
src/github.com/go-kit/kit/sd/consul/client.go:4:2: cannot find package "github.com/hashicorp/consul/api" in any of:
/usr/local/go/src/github.com/hashicorp/consul/api (from $GOROOT)
/go/src/github.com/hashicorp/consul/api (from $GOPATH)
src/github.com/go-kit/kit/examples/shipping/cargo/cargo.go:9:2: cannot find package "github.com/pborman/uuid" in any of:
/usr/local/go/src/github.com/pborman/uuid (from $GOROOT)
/go/src/github.com/pborman/uuid (from $GOPATH)
src/github.com/go-kit/kit/transport/nats/encode_decode.go:6:2: cannot find package "github.com/nats-io/go-nats" in any of:
/usr/local/go/src/github.com/nats-io/go-nats (from $GOROOT)
/go/src/github.com/nats-io/go-nats (from $GOPATH)
src/github.com/go-kit/kit/log/logrus/logrus_logger.go:10:2: cannot find package "github.com/sirupsen/logrus" in any of:
/usr/local/go/src/github.com/sirupsen/logrus (from $GOROOT)
/go/src/github.com/sirupsen/logrus (from $GOPATH)
src/github.com/go-kit/kit/metrics/generic/generic.go:13:2: cannot find package "github.com/VividCortex/gohistogram" in any of:
/usr/local/go/src/github.com/VividCortex/gohistogram (from $GOROOT)
/go/src/github.com/VividCortex/gohistogram (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch/cloudwatch.go:9:2: cannot find package "github.com/aws/aws-sdk-go/aws" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go/aws (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go/aws (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch/cloudwatch.go:10:2: cannot find package "github.com/aws/aws-sdk-go/service/cloudwatch" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go/service/cloudwatch (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go/service/cloudwatch (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch/cloudwatch.go:11:2: cannot find package "github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch2/cloudwatch2.go:10:2: cannot find package "github.com/aws/aws-sdk-go-v2/aws" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go-v2/aws (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go-v2/aws (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch2/cloudwatch2.go:11:2: cannot find package "github.com/aws/aws-sdk-go-v2/service/cloudwatch" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go-v2/service/cloudwatch (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go-v2/service/cloudwatch (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch2/cloudwatch2.go:12:2: cannot find package "github.com/aws/aws-sdk-go-v2/service/cloudwatch/cloudwatchiface" in any of:
/usr/local/go/src/github.com/aws/aws-sdk-go-v2/service/cloudwatch/cloudwatchiface (from $GOROOT)
/go/src/github.com/aws/aws-sdk-go-v2/service/cloudwatch/cloudwatchiface (from $GOPATH)
src/github.com/go-kit/kit/metrics/cloudwatch2/cloudwatch2.go:13:2: cannot find package "golang.org/x/sync/errgroup" in any of:
/usr/local/go/src/golang.org/x/sync/errgroup (from $GOROOT)
/go/src/golang.org/x/sync/errgroup (from $GOPATH)
src/github.com/go-kit/kit/metrics/influx/influx.go:9:2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of:
/usr/local/go/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT)
/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)
src/github.com/go-kit/kit/metrics/pcp/pcp.go:4:2: cannot find package "github.com/performancecopilot/speed" in any of:
/usr/local/go/src/github.com/performancecopilot/speed (from $GOROOT)
/go/src/github.com/performancecopilot/speed (from $GOPATH)
src/github.com/go-kit/kit/sd/etcd/client.go:13:2: cannot find package "go.etcd.io/etcd/client" in any of:
/usr/local/go/src/go.etcd.io/etcd/client (from $GOROOT)
/go/src/go.etcd.io/etcd/client (from $GOPATH)
src/github.com/go-kit/kit/sd/etcdv3/client.go:9:2: cannot find package "go.etcd.io/etcd/clientv3" in any of:
/usr/local/go/src/go.etcd.io/etcd/clientv3 (from $GOROOT)
/go/src/go.etcd.io/etcd/clientv3 (from $GOPATH)
src/github.com/go-kit/kit/sd/etcdv3/client.go:10:2: cannot find package "go.etcd.io/etcd/pkg/transport" in any of:
/usr/local/go/src/go.etcd.io/etcd/pkg/transport (from $GOROOT)
/go/src/go.etcd.io/etcd/pkg/transport (from $GOPATH)
src/github.com/go-kit/kit/sd/eureka/instancer.go:6:2: cannot find package "github.com/hudl/fargo" in any of:
/usr/local/go/src/github.com/hudl/fargo (from $GOROOT)
/go/src/github.com/hudl/fargo (from $GOPATH)
src/github.com/go-kit/kit/sd/zk/client.go:9:2: cannot find package "github.com/samuel/go-zookeeper/zk" in any of:
/usr/local/go/src/github.com/samuel/go-zookeeper/zk (from $GOROOT)
/go/src/github.com/samuel/go-zookeeper/zk (from $GOPATH)
src/github.com/go-kit/kit/tracing/opencensus/http.go:7:2: cannot find package "go.opencensus.io/plugin/ochttp" in any of:
/usr/local/go/src/go.opencensus.io/plugin/ochttp (from $GOROOT)
/go/src/go.opencensus.io/plugin/ochttp (from $GOPATH)
src/github.com/go-kit/kit/tracing/opencensus/http.go:8:2: cannot find package "go.opencensus.io/plugin/ochttp/propagation/b3" in any of:
/usr/local/go/src/go.opencensus.io/plugin/ochttp/propagation/b3 (from $GOROOT)
/go/src/go.opencensus.io/plugin/ochttp/propagation/b3 (from $GOPATH)
src/github.com/go-kit/kit/tracing/opencensus/endpoint.go:7:2: cannot find package "go.opencensus.io/trace" in any of:
/usr/local/go/src/go.opencensus.io/trace (from $GOROOT)
/go/src/go.opencensus.io/trace (from $GOPATH)
src/github.com/go-kit/kit/tracing/opencensus/grpc.go:7:2: cannot find package "go.opencensus.io/trace/propagation" in any of:
/usr/local/go/src/go.opencensus.io/trace/propagation (from $GOROOT)
/go/src/go.opencensus.io/trace/propagation (from $GOPATH)
src/github.com/go-kit/kit/transport/amqp/encode-decode.go:6:2: cannot find package "github.com/streadway/amqp" in any of:
/usr/local/go/src/github.com/streadway/amqp (from $GOROOT)
/go/src/github.com/streadway/amqp (from $GOPATH)
can't load package: package github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/gogo/collectorpb: code in directory /go/src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/gogo/collectorpb expects import "github.com/lightstep/lightstep-tracer-common/golang/gogo/collectorpb"
src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/gogo/collectorpb/collectorpbfakes/fake_collector_service_client.go:7:2: cannot find package "github.com/lightstep/lightstep-tracer-common/golang/gogo/collectorpb" in any of:
/usr/local/go/src/github.com/lightstep/lightstep-tracer-common/golang/gogo/collectorpb (from $GOROOT)
/go/src/github.com/lightstep/lightstep-tracer-common/golang/gogo/collectorpb (from $GOPATH)
can't load package: package github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/gogo/lightsteppb: code in directory /go/src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/gogo/lightsteppb expects import "github.com/lightstep/lightstep-tracer-common/golang/gogo/lightsteppb"
can't load package: package github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/protobuf/collectorpb: code in directory /go/src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/protobuf/collectorpb expects import "github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb"
src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/protobuf/collectorpb/collectorpbfakes/fake_collector_service_client.go:7:2: cannot find package "github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb" in any of:
/usr/local/go/src/github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb (from $GOROOT)
/go/src/github.com/lightstep/lightstep-tracer-common/golang/protobuf/collectorpb (from $GOPATH)
can't load package: package github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/protobuf/lightsteppb: code in directory /go/src/github.com/lightstep/lightstep-tracer-go/lightstep-tracer-common/golang/protobuf/lightsteppb expects import "github.com/lightstep/lightstep-tracer-common/golang/protobuf/lightsteppb"
src/github.com/lightstep/thrift/lib/go/test/tests/protocol_mock.go:27:2: cannot find package "code.google.com/p/gomock/gomock" in any of:
/usr/local/go/src/code.google.com/p/gomock/gomock (from $GOROOT)
/go/src/code.google.com/p/gomock/gomock (from $GOPATH)
src/github.com/lightstep/thrift/tutorial/go/src/client.go:25:2: cannot find package "git.apache.org/thrift.git/lib/go/thrift" in any of:
/usr/local/go/src/git.apache.org/thrift.git/lib/go/thrift (from $GOROOT)
/go/src/git.apache.org/thrift.git/lib/go/thrift (from $GOPATH)
src/github.com/oklog/oklog/pkg/store/read.go:10:2: cannot find package "github.com/djherbis/buffer" in any of:
/usr/local/go/src/github.com/djherbis/buffer (from $GOROOT)
/go/src/github.com/djherbis/buffer (from $GOPATH)
src/github.com/oklog/oklog/pkg/store/read.go:11:2: cannot find package "github.com/djherbis/nio" in any of:
/usr/local/go/src/github.com/djherbis/nio (from $GOROOT)
/go/src/github.com/djherbis/nio (from $GOPATH)
src/github.com/oklog/oklog/pkg/stream/deduplicate.go:8:2: cannot find package "github.com/google/btree" in any of:
/usr/local/go/src/github.com/google/btree (from $GOROOT)
/go/src/github.com/google/btree (from $GOPATH)
src/github.com/oklog/oklog/pkg/cluster/advertise.go:10:2: cannot find package "github.com/hashicorp/go-sockaddr" in any of:
/usr/local/go/src/github.com/hashicorp/go-sockaddr (from $GOROOT)
/go/src/github.com/hashicorp/go-sockaddr (from $GOPATH)
src/github.com/oklog/oklog/pkg/cluster/peer.go:21:2: cannot find package "github.com/hashicorp/memberlist" in any of:
/usr/local/go/src/github.com/hashicorp/memberlist (from $GOROOT)
/go/src/github.com/hashicorp/memberlist (from $GOPATH)
src/github.com/oklog/oklog/pkg/ingest/conn.go:16:2: cannot find package "github.com/oklog/ulid" in any of:
/usr/local/go/src/github.com/oklog/ulid (from $GOROOT)
/go/src/github.com/oklog/ulid (from $GOPATH)
src/github.com/oklog/oklog/cmd/oklog/ingest.go:17:2: cannot find package "github.com/rs/cors" in any of:
/usr/local/go/src/github.com/rs/cors (from $GOROOT)
/go/src/github.com/rs/cors (from $GOPATH)
src/github.com/opentracing/opentracing-go/harness/api_checkers.go:31:2: cannot find package "github.com/stretchr/testify/assert" in any of:
/usr/local/go/src/github.com/stretchr/testify/assert (from $GOROOT)
/go/src/github.com/stretchr/testify/assert (from $GOPATH)
src/github.com/opentracing/opentracing-go/harness/api_checkers.go:32:2: cannot find package "github.com/stretchr/testify/suite" in any of:
/usr/local/go/src/github.com/stretchr/testify/suite (from $GOROOT)
/go/src/github.com/stretchr/testify/suite (from $GOPATH)
src/github.com/pierrec/lz4/lz4c/main.go:15:2: cannot find package "github.com/pkg/profile" in any of:
/usr/local/go/src/github.com/pkg/profile (from $GOROOT)
/go/src/github.com/pkg/profile (from $GOPATH)
src/github.com/prometheus/common/config/http_config.go:26:2: cannot find package "github.com/mwitkow/go-conntrack" in any of:
/usr/local/go/src/github.com/mwitkow/go-conntrack (from $GOROOT)
/go/src/github.com/mwitkow/go-conntrack (from $GOPATH)
src/github.com/prometheus/common/config/http_config.go:27:2: cannot find package "gopkg.in/yaml.v2" in any of:
/usr/local/go/src/gopkg.in/yaml.v2 (from $GOROOT)
/go/src/gopkg.in/yaml.v2 (from $GOPATH)
src/github.com/prometheus/common/log/log.go:28:2: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of:
/usr/local/go/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT)
/go/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)
src/github.com/prometheus/common/route/route.go:7:2: cannot find package "github.com/julienschmidt/httprouter" in any of:
/usr/local/go/src/github.com/julienschmidt/httprouter (from $GOROOT)
/go/src/github.com/julienschmidt/httprouter (from $GOPATH)
src/github.com/rcrowley/go-metrics/stathat/stathat.go:6:2: cannot find package "github.com/stathat/go" in any of:
/usr/local/go/src/github.com/stathat/go (from $GOROOT)
/go/src/github.com/stathat/go (from $GOPATH)
src/golang.org/x/net/http2/h2i/h2i.go:38:2: cannot find package "golang.org/x/crypto/ssh/terminal" in any of:
/usr/local/go/src/golang.org/x/crypto/ssh/terminal (from $GOROOT)
/go/src/golang.org/x/crypto/ssh/terminal (from $GOPATH)
src/golang.org/x/text/cmd/gotext/main.go:31:2: cannot find package "golang.org/x/tools/go/buildutil" in any of:
/usr/local/go/src/golang.org/x/tools/go/buildutil (from $GOROOT)
/go/src/golang.org/x/tools/go/buildutil (from $GOPATH)
src/golang.org/x/text/message/pipeline/extract.go:22:2: cannot find package "golang.org/x/tools/go/callgraph" in any of:
/usr/local/go/src/golang.org/x/tools/go/callgraph (from $GOROOT)
/go/src/golang.org/x/tools/go/callgraph (from $GOPATH)
src/golang.org/x/text/message/pipeline/extract.go:23:2: cannot find package "golang.org/x/tools/go/callgraph/cha" in any of:
/usr/local/go/src/golang.org/x/tools/go/callgraph/cha (from $GOROOT)
/go/src/golang.org/x/tools/go/callgraph/cha (from $GOPATH)
src/golang.org/x/text/message/pipeline/extract.go:24:2: cannot find package "golang.org/x/tools/go/loader" in any of:
/usr/local/go/src/golang.org/x/tools/go/loader (from $GOROOT)
/go/src/golang.org/x/tools/go/loader (from $GOPATH)
src/golang.org/x/text/message/pipeline/extract.go:25:2: cannot find package "golang.org/x/tools/go/ssa" in any of:
/usr/local/go/src/golang.org/x/tools/go/ssa (from $GOROOT)
/go/src/golang.org/x/tools/go/ssa (from $GOPATH)
src/golang.org/x/text/message/pipeline/extract.go:26:2: cannot find package "golang.org/x/tools/go/ssa/ssautil" in any of:
/usr/local/go/src/golang.org/x/tools/go/ssa/ssautil (from $GOROOT)
/go/src/golang.org/x/tools/go/ssa/ssautil (from $GOPATH)
src/google.golang.org/grpc/credentials/oauth/oauth.go:28:2: cannot find package "golang.org/x/oauth2" in any of:
/usr/local/go/src/golang.org/x/oauth2 (from $GOROOT)
/go/src/golang.org/x/oauth2 (from $GOPATH)
src/google.golang.org/grpc/credentials/oauth/oauth.go:29:2: cannot find package "golang.org/x/oauth2/google" in any of:
/usr/local/go/src/golang.org/x/oauth2/google (from $GOROOT)
/go/src/golang.org/x/oauth2/google (from $GOPATH)
src/google.golang.org/grpc/credentials/oauth/oauth.go:30:2: cannot find package "golang.org/x/oauth2/jwt" in any of:
/usr/local/go/src/golang.org/x/oauth2/jwt (from $GOROOT)
/go/src/golang.org/x/oauth2/jwt (from $GOPATH)
src/google.golang.org/grpc/grpclog/glogger/glogger.go:26:2: cannot find package "github.com/golang/glog" in any of:
/usr/local/go/src/github.com/golang/glog (from $GOROOT)
/go/src/github.com/golang/glog (from $GOPATH)
src/sourcegraph.com/sourcegraph/appdash/cmd/appdash/appdash.go:58:2: cannot find package "github.com/jessevdk/go-flags" in any of:
/usr/local/go/src/github.com/jessevdk/go-flags (from $GOROOT)
/go/src/github.com/jessevdk/go-flags (from $GOPATH)
src/sourcegraph.com/sourcegraph/appdash/traceapp/app.go:34:2: cannot find package "sourcegraph.com/sourcegraph/appdash-data" in any of:
/usr/local/go/src/sourcegraph.com/sourcegraph/appdash-data (from $GOROOT)
/go/src/sourcegraph.com/sourcegraph/appdash-data (from $GOPATH)
src/sourcegraph.com/sourcegraph/appdash/examples/cmd/webapp/main.go:20:2: cannot find package "github.com/urfave/negroni" in any of:
/usr/local/go/src/github.com/urfave/negroni (from $GOROOT)
/go/src/github.com/urfave/negroni (from $GOPATH)
ERROR: Service 'bugs' failed to build: The command '/bin/sh -c go get -t -v ./...' returned a non-zero code: 1

 
 

Yes, finally had a time to find a problem, it was an issue with Dockerfile. Updated it in the repo - github.com/plutov/packagemain/tree...

 

Hi Alex, thanks for your useful article, I cant run the project and got these errors :


Building bugs
Step 1/8 : FROM golang
---> be63d15101cb
Step 2/8 : RUN mkdir -p /go/src/ghoghnos.ir/bugTracker
---> Using cache
---> 1efb9ce59766
Step 3/8 : ADD . /go/src/ghoghnos.ir/bugTracker
---> Using cache
---> 391b43650c2e
Step 4/8 : WORKDIR /go/src/ghoghnos.ir/bugTracker/bugs
---> Using cache
---> 7bc6a3ec3222
Step 5/8 : RUN go get -t -v ./...
---> Running in 05432adea1bb
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
ignoring ../go.mod;
see 'go help modules'
github.com/go-kit/kit (download)

cd .; git clone github.com/go-kit/kit /go/src/github.com/go-kit/kit

Cloning into '/go/src/github.com/go-kit/kit'...
fatal: unable to access 'github.com/go-kit/kit/': Could not resolve host: github.com
package github.com/go-kit/kit/log: exit status 128
package github.com/go-kit/kit/endpoint: cannot find package "github.com/go-kit/kit/endpoint" in any of:
/usr/local/go/src/github.com/go-kit/kit/endpoint (from $GOROOT)
/go/src/github.com/go-kit/kit/endpoint (from $GOPATH)
package github.com/go-kit/kit/metrics: cannot find package "github.com/go-kit/kit/metrics" in any of:
/usr/local/go/src/github.com/go-kit/kit/metrics (from $GOROOT)
/go/src/github.com/go-kit/kit/metrics (from $GOPATH)
package github.com/go-kit/kit/transport/http: cannot find package "github.com/go-kit/kit/transport/http" in any of:
/usr/local/go/src/github.com/go-kit/kit/transport/http (from $GOROOT)
/go/src/github.com/go-kit/kit/transport/http (from $GOPATH)
package github.com/go-kit/kit/metrics/prometheus: cannot find package "github.com/go-kit/kit/metrics/prometheus" in any of:
/usr/local/go/src/github.com/go-kit/kit/metrics/prometheus (from $GOROOT)
/go/src/github.com/go-kit/kit/metrics/prometheus (from $GOPATH)
package github.com/go-kit/kit/tracing/opentracing: cannot find package "github.com/go-kit/kit/tracing/opentracing" in any of:
/usr/local/go/src/github.com/go-kit/kit/tracing/opentracing (from $GOROOT)
/go/src/github.com/go-kit/kit/tracing/opentracing (from $GOPATH)
github.com/lightstep/lightstep-tracer-go (download)

cd .; git clone github.com/lightstep/lightstep-tra... /go/src/github.com/lightstep/lightstep-tracer-go

Cloning into '/go/src/github.com/lightstep/lightstep-tracer-go'...
fatal: unable to access 'github.com/lightstep/lightstep-tra... Could not resolve host: github.com
package github.com/lightstep/lightstep-tracer-go: exit status 128
github.com/oklog/oklog (download)

cd .; git clone github.com/oklog/oklog /go/src/github.com/oklog/oklog

Cloning into '/go/src/github.com/oklog/oklog'...
fatal: unable to access 'github.com/oklog/oklog/': Could not resolve host: github.com
package github.com/oklog/oklog/pkg/group: exit status 128
github.com/opentracing/opentracing-go (download)

cd .; git clone github.com/opentracing/opentracing-go /go/src/github.com/opentracing/opentracing-go

Cloning into '/go/src/github.com/opentracing/opentracing-go'...
fatal: unable to access 'github.com/opentracing/opentracing... Could not resolve host: github.com
package github.com/opentracing/opentracing-go: exit status 128
github.com/openzipkin/zipkin-go-opentracing (download)

cd .; git clone github.com/openzipkin/zipkin-go-op... /go/src/github.com/openzipkin/zipkin-go-opentracing

Cloning into '/go/src/github.com/openzipkin/zipkin-go-opentracing'...
fatal: unable to access 'github.com/openzipkin/zipkin-go-op... Could not resolve host: github.com
package github.com/openzipkin/zipkin-go-opentracing: exit status 128
github.com/prometheus/client_golang (download)

cd .; git clone github.com/prometheus/client_golang /go/src/github.com/prometheus/client_golang

Cloning into '/go/src/github.com/prometheus/client_golang'...
fatal: unable to access 'github.com/prometheus/client_golan... Could not resolve host: github.com
package github.com/prometheus/client_golang/prometheus: exit status 128
package github.com/prometheus/client_golang/prometheus/promhttp: cannot find package "github.com/prometheus/client_golang/prometheus/promhttp" in any of:
/usr/local/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOROOT)
/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOPATH)
Fetching sourcegraph.com/sourcegraph/appdas...
https fetch failed: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied
package sourcegraph.com/sourcegraph/appdash: unrecognized import path "sourcegraph.com/sourcegraph/appdash" (https fetch: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied)
Fetching sourcegraph.com/sourcegraph/appdas...
https fetch failed: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied
package sourcegraph.com/sourcegraph/appdash/opentracing: unrecognized import path "sourcegraph.com/sourcegraph/appdash/opentracing" (https fetch: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied)
ERROR: Service 'bugs' failed to build: The command '/bin/sh -c go get -t -v ./...' returned a non-zero code: 1
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/go-kit/kit/endpoint (from $GOPATH)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/go-kit/kit/metrics: cannot find package "github.com/go-kit/kit/metrics" in any of:
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /usr/local/go/src/github.com/go-kit/kit/metrics (from $GOROOT)
bash: syntax error near unexpected token
from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/go-kit/kit/metrics (from $GOPATH)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/go-kit/kit/transport/http: cannot find package "github.com/go-kit/kit/transport/http" in any of:
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /usr/local/go/src/github.com/go-kit/kit/transport/http (from $GOROOT)
bash: syntax error near unexpected token
from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/go-kit/kit/transport/http (from $GOPATH)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/go-kit/kit/metrics/prometheus: cannot find package "github.com/go-kit/kit/metrics/prometheus" in any of:
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /usr/local/go/src/github.com/go-kit/kit/metrics/prometheus (from $GOROOT)
bash: syntax error near unexpected token
from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/go-kit/kit/metrics/prometheus (from $GOPATH)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/go-kit/kit/tracing/opentracing: cannot find package "github.com/go-kit/kit/tracing/opentracing" in any of:
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /usr/local/go/src/github.com/go-kit/kit/tracing/opentracing (from $GOROOT)
bash: syntax error near unexpected token
from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/go-kit/kit/tracing/opentracing (from $GOPATH)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ github.com/lightstep/lightstep-tracer-go (download)
bash: syntax error near unexpected token
download'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ # cd .; git clone github.com/lightstep/lightstep-tra... /go/src/github.com/lightstep/lightstep-tracer-go
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Cloning into '/go/src/github.com/lightstep/lightstep-tracer-go'...
bash: Cloning: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ fatal: unable to access 'github.com/lightstep/lightstep-tra... Could not resolve host: github.com
bash: fatal:: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/lightstep/lightstep-tracer-go: exit status 128
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ github.com/oklog/oklog (download)
bash: syntax error near unexpected token download'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ # cd .; git clone https://github.com/oklog/oklog /go/src/github.com/oklog/oklog
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Cloning into '/go/src/github.com/oklog/oklog'...
bash: Cloning: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ fatal: unable to access 'https://github.com/oklog/oklog/': Could not resolve host: github.com
bash: fatal:: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/oklog/oklog/pkg/group: exit status 128
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ github.com/opentracing/opentracing-go (download)
bash: syntax error near unexpected token
download'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ # cd .; git clone github.com/opentracing/opentracing-go /go/src/github.com/opentracing/opentracing-go
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Cloning into '/go/src/github.com/opentracing/opentracing-go'...
bash: Cloning: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ fatal: unable to access 'github.com/opentracing/opentracing... Could not resolve host: github.com
bash: fatal:: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/opentracing/opentracing-go: exit status 128
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ github.com/openzipkin/zipkin-go-opentracing (download)
bash: syntax error near unexpected token download'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ # cd .; git clone https://github.com/openzipkin/zipkin-go-opentracing /go/src/github.com/openzipkin/zipkin-go-opentracing
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Cloning into '/go/src/github.com/openzipkin/zipkin-go-opentracing'...
bash: Cloning: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ fatal: unable to access 'https://github.com/openzipkin/zipkin-go-opentracing/': Could not resolve host: github.com
bash: fatal:: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/openzipkin/zipkin-go-opentracing: exit status 128
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ github.com/prometheus/client_golang (download)
bash: syntax error near unexpected token
download'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ # cd .; git clone github.com/prometheus/client_golang /go/src/github.com/prometheus/client_golang
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Cloning into '/go/src/github.com/prometheus/client_golang'...
bash: Cloning: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ fatal: unable to access 'github.com/prometheus/client_golan... Could not resolve host: github.com
bash: fatal:: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/prometheus/client_golang/prometheus: exit status 128
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package github.com/prometheus/client_golang/prometheus/promhttp: cannot find package "github.com/prometheus/client_golang/prometheus/promhttp" in any of:
bash: package: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /usr/local/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOROOT)
bash: syntax error near unexpected token from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ /go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOPATH)
bash: syntax error near unexpected token
from'
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Fetching sourcegraph.com/sourcegraph/appdas...
bash: Fetching: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ https fetch failed: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied
bash: https: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package sourcegraph.com/sourcegraph/appdash: unrecognized import path "sourcegraph.com/sourcegraph/appdash" (https fetch: Get sourcegraph.com/sourcegraph/appdas... dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied)
bash: syntax error near unexpected token ('
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ Fetching https://sourcegraph.com/sourcegraph/appdash/opentracing?go-get=1
bash: Fetching: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ https fetch failed: Get https://sourcegraph.com/sourcegraph/appdash/opentracing?go-get=1: dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied
bash: https: command not found
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ package sourcegraph.com/sourcegraph/appdash/opentracing: unrecognized import path "sourcegraph.com/sourcegraph/appdash/opentracing" (https fetch: Get https://sourcegraph.com/sourcegraph/appdash/opentracing?go-get=1: dial tcp: lookup sourcegraph.com on 4.2.2.4:53: dial udp 4.2.2.4:53: socket: permission denied)
bash: syntax error near unexpected token
('
mr-ghoroubi@mr-ghoroubi-PC:~/workspace/src/ghoghnos.ir/bugTracker$ ERROR: Service 'bugs' failed to build: The command '/bin/sh -c go get -t -v ./...' returned a non-zero code: 1
bash: ERROR:: command not found

 

Hi Alex - I'm not trying to be super annoying or anything but technically you aren't allowed to use the Gophercises Gopher you used in your banner image without my permission. I know that is odd since most gophers are licensed with a creative commons license, but that isn't the case here. The exercising gophers are a big part of the course branding and I'd really prefer not to have them used elsewhere on the web. Would you mind updating the image with another Gopher that is CC licensed? I'm happy to help you find one.

 

Hi Jon, I didn't know this! Sorry for that, will update all places where I've used this image.

 

No worries, thanks for agreeing to update, and keep up the work on the videos :)

 

Hello Alex,
I have followed the above instructions of yours to install go-kit cli:

  • go get github.com/go-kit/kit
  • go get github.com/kujtimiihoxha/kit

After the installation was completed, I tried running the command: kit new service users, but received an error like this:
'kit' is not recognized as an internal or external command,
operable program or batch file.

Please kindly guide me to fix this problem

 

Hi Alex. I read your article and tried to implement it. I got stuck on one thing, while I try to run docker-compose up it shows me error

 

Please provide what type of error does it show. But it is probably a problem with kit package, have a look into this PR - github.com/kujtimiihoxha/kit/pull/20, you have to fix WORKDIR in Dockerfile.

 

bugs | 2019/05/13 07:55:56 wrong watcher package: /go/src//media/ghost/Software/projects/personal/web-project/tripsansar/tripsansar-backend-go-kit/src/gitlab.com/tripsansar/bugs

I am not sure about it but it could be the problem with Dockerfile conf

 

Hi Alex,

I want to integration the Opentracing and jaeger in the service.
How can I do it? so right now I running "kit g m opentracing -s receiver -e" is it correct or not?
I do my best to try understand your structure.
if you don't mind can give me some help.

 

hi Alex, i want to ask you something

i have installed protoc
protoc --version => libprotoc 3.9.0

and i have downloaded grpc
go get -u google.golang.org/grpc

i run command "kit generate service notificator -t grpc --dmw" i have message "warn[0000]the GRPC implementation is not finished you need to update your service protobuf"

can you help me about it

 

Hi Alex,

When i run
kit generate service notificator -t grpc --dmw

I get:
ERRO[0000] exit status 1

I have:
protoc --version
libprotoc 3.7.1

 

I have solved this problem, it appears that i had not installed protoc-gen-go. So in case anyone else have similar problem take a look at this github.com/grpc/homebrew-grpc/issu...

 

how did you figure out missing package is the problem?
I am getting same error but doesn't look liek protoc-gen-go missing case.

 

This have a package problems versions....

if anybody needs the code working go here: github.com/yefriddavid/garlic.git

 

When I run docker-compose up I get ERROR: Service 'test' failed to build: The command '/bin/sh -c go get -t -v ./...' returned a non-zero code: 2

What does it mean ?

 

The Dockerfile has a mistake, I fixed it on the github, please check it from there.

code of conduct - report abuse