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

splunkclient-go does not build or run tests, cannot be imported #2890

Closed
andrewwdye opened this issue Feb 15, 2024 · 0 comments · Fixed by #2891
Closed

splunkclient-go does not build or run tests, cannot be imported #2890

andrewwdye opened this issue Feb 15, 2024 · 0 comments · Fixed by #2891
Labels
bug Something isn't working

Comments

@andrewwdye
Copy link
Contributor

Describe the issue
The go:build directives in splunkclient-go prevent building in recent versions of go. Attempts to import github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/transport per the example fail with undefined errors.

Looks like this attempt to require >= go1.17 does not work as expected and should instead by a single directive like //go:build go1.17 to indicate min version.

Steps to reproduce the issue:

❯ git clone https://github.com/signalfx/splunk-otel-go.git

❯ cd splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go

❯ go test ./... -v
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/internal/config	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/option	[no test files]
?   	github.com/signalfx/splunk-otel-go/instrumentation/k8s.io/client-go/splunkclient-go/transport	[no test files]

❯ go version
go version go1.21.3 darwin/arm64

Attempted solutions and workarounds
Simply replacing

//go:build !(go1.1 || go1.2 || go1.3 || go1.4 || go1.5 || go1.6 || go1.7 || go1.8 || go1.9 || go1.10 || go1.11 || go1.12 || go1.13 || go1.14 || go1.15 || go1.16)
// +build !go1.1,!go1.2,!go1.3,!go1.4,!go1.5,!go1.6,!go1.7,!go1.8,!go1.9,!go1.10,!go1.11,!go1.12,!go1.13,!go1.14,!go1.15,!go1.16

with

//go:build go1.17
// +build go1.17

seems to address the problem

Expected behavior
Existing tests run

Environment
Complete the following information:

  • OS version: macOS
  • Go version: 1.21.3 darwin/arm64
  • splunk-otel-go version: 1.13.0

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant