diff --git a/instrumentation/net/http/otelhttp/internal/semconv/gen.go b/instrumentation/net/http/otelhttp/internal/semconv/gen.go index 32630864bf2..f2cf8a152d3 100644 --- a/instrumentation/net/http/otelhttp/internal/semconv/gen.go +++ b/instrumentation/net/http/otelhttp/internal/semconv/gen.go @@ -4,11 +4,11 @@ package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" // Generate semconv package: -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={}" --out=bench_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env.go.tmpl "--data={}" --out=env.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env_test.go.tmpl "--data={}" --out=env_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv.go.tmpl "--data={}" --out=httpconv.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv_test.go.tmpl "--data={}" --out=httpconv_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util.go.tmpl "--data={}" --out=util.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util_test.go.tmpl "--data={}" --out=util_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconv/v1.20.0.go.tmpl "--data={}" --out=v1.20.0.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=bench_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=env.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=env_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconv.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconv_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/v1.20.0.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=v1.20.0.go diff --git a/instrumentation/net/http/otelhttp/internal/semconv/test/gen.go b/instrumentation/net/http/otelhttp/internal/semconv/test/gen.go index c67a0ddd554..5a5769dc9c7 100644 --- a/instrumentation/net/http/otelhttp/internal/semconv/test/gen.go +++ b/instrumentation/net/http/otelhttp/internal/semconv/test/gen.go @@ -4,6 +4,6 @@ package test // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/test" // Generate semconv/test package: -//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/common_test.go.tmpl "--data={}" --out=common_test.go -//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/httpconv_test.go.tmpl "--data={}" --out=httpconv_test.go -//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/v1.20.0_test.go.tmpl "--data={}" --out=v1.20.0_test.go +//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/common_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=common_test.go +//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/httpconv_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconv_test.go +//go:generate gotmpl --body=../../../../../../../internal/shared/semconv/test/v1.20.0_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=v1.20.0_test.go diff --git a/internal/shared/semconv/httpconv.go.tmpl b/internal/shared/semconv/httpconv.go.tmpl index 8c3c6275133..203ec3eebe2 100644 --- a/internal/shared/semconv/httpconv.go.tmpl +++ b/internal/shared/semconv/httpconv.go.tmpl @@ -4,7 +4,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv import ( "fmt" diff --git a/internal/shared/semconv/test/common_test.go.tmpl b/internal/shared/semconv/test/common_test.go.tmpl index c77078ba4a4..14ee09591ff 100644 --- a/internal/shared/semconv/test/common_test.go.tmpl +++ b/internal/shared/semconv/test/common_test.go.tmpl @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" + "{{.pkg}}/internal/semconv" "go.opentelemetry.io/otel/attribute" ) diff --git a/internal/shared/semconv/test/httpconv_test.go.tmpl b/internal/shared/semconv/test/httpconv_test.go.tmpl index 768cf7708c3..d9e96110378 100644 --- a/internal/shared/semconv/test/httpconv_test.go.tmpl +++ b/internal/shared/semconv/test/httpconv_test.go.tmpl @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" + "{{.pkg}}/internal/semconv" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/sdk/instrumentation" @@ -391,7 +391,7 @@ func TestRequestErrorType(t *testing.T) { want attribute.KeyValue }{ {err: errors.New("http: nil Request.URL"), want: attribute.String("error.type", "*errors.errorString")}, - {err: customError{}, want: attribute.String("error.type", "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/test.customError")}, + {err: customError{}, want: attribute.String("error.type", "{{.pkg}}/internal/semconv/test.customError")}, } for _, tt := range testcases { diff --git a/internal/shared/semconv/test/v1.20.0_test.go.tmpl b/internal/shared/semconv/test/v1.20.0_test.go.tmpl index f5caed6442b..c3630b013de 100644 --- a/internal/shared/semconv/test/v1.20.0_test.go.tmpl +++ b/internal/shared/semconv/test/v1.20.0_test.go.tmpl @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" + "{{.pkg}}/internal/semconv" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/instrumentation" sdkmetric "go.opentelemetry.io/otel/sdk/metric" diff --git a/internal/shared/semconv/util.go.tmpl b/internal/shared/semconv/util.go.tmpl index 558efd0594b..27b9fa60ccb 100644 --- a/internal/shared/semconv/util.go.tmpl +++ b/internal/shared/semconv/util.go.tmpl @@ -4,7 +4,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv import ( "net" diff --git a/internal/shared/semconv/v1.20.0.go.tmpl b/internal/shared/semconv/v1.20.0.go.tmpl index 57d1507b620..5195c273d4d 100644 --- a/internal/shared/semconv/v1.20.0.go.tmpl +++ b/internal/shared/semconv/v1.20.0.go.tmpl @@ -4,7 +4,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" +package semconv import ( "errors" @@ -12,7 +12,7 @@ import ( "net/http" "slices" - "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil" + "{{.pkg}}/internal/semconvutil" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/noop"