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

cmd/fastly-exporter: move roundTripperFunc, userAgentTransport into main.go, allowing "go run cmd/fastly-exporter/main.go" #105

Merged
merged 1 commit into from
May 23, 2022

Conversation

shawnps
Copy link
Contributor

@shawnps shawnps commented May 23, 2022

No description provided.

…ain.go, allowing "go run cmd/fastly-exporter/main.go"
@shawnps shawnps requested a review from hermanschaaf May 23, 2022 05:10
@shawnps shawnps merged commit 396dba4 into main May 23, 2022
@shawnps shawnps deleted the go-run branch May 23, 2022 08:30
@peterbourgon
Copy link
Contributor

go run is meant as a convenience for trivial, generally single-file, script-ish Go programs. It's not really something that should be used with projects like this. It calculates the source that goes into the compilation unit in a way that's different than all other go tool subcommands, which is confusing -- hence this PR! 😉 And it doesn't take advantage of intermediate build caching to the extent that go build and/or go install do.

Anyone working on this project should be building-and-running via

go build ./cmd/fastly-exporter 
./fastly-exporter ...

or

go install ./cmd/fastly-exporter
fastly-exporter ...

But if you insist on using go run 😉 then you should be able to go run cmd/fastly-exporter — i.e. eliding the main.go — which should work without requiring the change in this PR?

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

Successfully merging this pull request may close these issues.

3 participants