Git Product home page Git Product logo

Comments (9)

octo avatar octo commented on May 27, 2024 11

Hi @flyinva,

the context package has been added in Go 1.7 and is required to build collectd_exporter.

Best regards,
β€”octo

from collectd_exporter.

yassermog avatar yassermog commented on May 27, 2024 6

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin

from collectd_exporter.

briffle avatar briffle commented on May 27, 2024 3

@padgyx I had the exact same error on centos 7. It runs a very old version of golang (1.6.3) I used this repo and instructions to update, and its working well:
https://go-repo.io/

specifically:

sudo rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
sudo yum update golang

from collectd_exporter.

flyinva avatar flyinva commented on May 27, 2024

Go 1.7 is only available in Debian testing. I will have to wait some times for this version in backports.

from collectd_exporter.

octo avatar octo commented on May 27, 2024

It's very unfortunate that there is no good transition path from the old (experimental) x/net/context package and the Go 1.7 context package :\

One thing we can consider is add an appropriate build constraint, like:

// +build go1.7

However, the error message when building with earlier versions of Go is something along the lines of:

go build github.com/prometheus/collectd_exporter: no buildable Go source files in $GOPATH/src/github.com/prometheus/collectd_exporter

I'm not sure this error message is an improvement though :\

from collectd_exporter.

flyinva avatar flyinva commented on May 27, 2024

collectd_exporter can be build with Go 1.7 on Debian SID (and probably any other distrib) and run on Debian Jessie.

from collectd_exporter.

 avatar commented on May 27, 2024

go get github.com/prometheus/prometheus/cmd/promtool
package context: unrecognized import path "context" (import path does not begin with hostname)

from collectd_exporter.

AlexN93 avatar AlexN93 commented on May 27, 2024

I'm having the exact same problem and I'm running go version go1.2.1 linux/amd64 on Ubuntu 14 virtual machine.

from collectd_exporter.

brian-brazil avatar brian-brazil commented on May 27, 2024

You generally need the latest version of Go when building Go components of Prometheus, with the exception of using client_golang which currently supports back to Go 1.7.

from collectd_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.