Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.go undefined: target #41

Open
randomizedcoder opened this issue Mar 10, 2021 · 1 comment
Open

main.go undefined: target #41

randomizedcoder opened this issue Mar 10, 2021 · 1 comment

Comments

@randomizedcoder
Copy link

G'day,

This project looks pretty cool, but seems like it doesn't build, although maybe I'm being silly.

das@das-dell5580:~/go/src/github.com/czerwonk$ rm -rf ping_exporter/
das@das-dell5580:~/go/src/github.com/czerwonk$ git clone https://github.com/czerwonk/ping_exporter.git
Cloning into 'ping_exporter'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 3162 (delta 8), reused 4 (delta 0), pack-reused 3137
Receiving objects: 100% (3162/3162), 5.35 MiB | 7.58 MiB/s, done.
Resolving deltas: 100% (1092/1092), done.
das@das-dell5580:~/go/src/github.com/czerwonk$ cd ping_exporter/
das@das-dell5580:~/go/src/github.com/czerwonk/ping_exporter$ go build main.go 
# command-line-arguments
./main.go:138:21: undefined: target
./main.go:140:9: undefined: target
./main.go:159:61: undefined: target
./main.go:169:28: undefined: target
./main.go:172:15: undefined: target
./main.go:188:20: undefined: pingCollector

Possibly:

  • a Makefile would make things more clear how to build this.
  • target.go seems to define "target"
@dmke
Copy link
Contributor

dmke commented Mar 18, 2021

This is an easy trap to fall in:

$ go build *.go

or just

$ go build

should get you a ./ping_exporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants