Citrix-NetScaler-Exporter icon indicating copy to clipboard operation
Citrix-NetScaler-Exporter copied to clipboard

Various Errors when Installing Module

Open gsperry2011 opened this issue 3 years ago • 1 comments

Apologies if this is me doing something incorrect, am new to golang.

I am running:

go version go1.15.5 linux/amd64

When I run:

 import path does not begin with hostname

It returns with:

package citrix-netscaler-exporter/collector: unrecognized import path "citrix-netscaler-exporter/collector": import path does not begin with hostname

I came across https://stackoverflow.com/questions/47187280/unrecognized-import-path-import-path-does-not-begin-with-hostname

EDIT:

I was able to get around the above error by adding

export GO111MODULE=on

to my shell.

I am now seeing:

go get github.com/rokett/citrix-netscaler-exporter
go: downloading github.com/rokett/citrix-netscaler-exporter v0.0.0-20210223201402-f2112a388ff9
go: github.com/rokett/citrix-netscaler-exporter upgrade => v0.0.0-20210223201402-f2112a388ff9
go get: github.com/rokett/[email protected]: parsing go.mod:
        module declares its path as: citrix-netscaler-exporter
                but was required as: github.com/rokett/citrix-netscaler-exporter

After coding around the above error I am now seeing:

go: github.com/gsperry2011/citrix-netscaler-exporter 4.5.2 => v0.0.0-20210308172404-e73d7091eb82
../go/pkg/mod/github.com/gsperry2011/[email protected]/collector/aaa.go:6:2: package citrix-netscaler-exporter/netscaler is not in GOROOT (/usr/lib/golang/src/citrix-netscaler-exporter/netscaler)

Am now seeing:

../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/connect.go:58:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/connect.go:67:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/disconnect.go:51:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/get_config.go:35:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/get_config.go:39:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/get_stats.go:35:14: undefined: io.ReadAll
../go/pkg/mod/github.com/gsperry2011/[email protected]/netscaler/get_stats.go:39:14: undefined: io.ReadAll

I'll keep updating as I go. Fixes here if anyone needs: https://github.com/gsperry2011/Citrix-NetScaler-Exporter/pull/1

gsperry2011 avatar Mar 08 '21 16:03 gsperry2011

I am now successfully installing this module using my fixes. I am pointing at my forked branch to install (not sure if it's a requirement in the imports or not because I am installing using

 go get github.com/gsperry2011/[email protected]
go get github.com/gsperry2011/[email protected]
go: downloading github.com/gsperry2011/citrix-netscaler-exporter v0.0.0-20210308174923-a577851de2aa
go: github.com/gsperry2011/citrix-netscaler-exporter 4.5.2 => v0.0.0-20210308174923-a577851de2aa
go: downloading github.com/prometheus/client_golang v0.8.0
go: downloading github.com/go-kit/kit v0.6.0
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/prometheus/common v0.0.0-20171006141418-1bab55dd05db
go: downloading github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612
go: downloading github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8
go: downloading github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a
go: downloading github.com/golang/protobuf v0.0.0-20170920220647-130e6b02ab05
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.0
go: downloading github.com/go-logfmt/logfmt v0.3.0
go: downloading github.com/go-stack/stack v1.6.0
go: downloading github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515

gsperry2011 avatar Mar 08 '21 17:03 gsperry2011