Skip to content

Commit b37ab00

Browse files
committed
use const for env var
Signed-off-by: alex boten <[email protected]>
1 parent 1db63ad commit b37ab00

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

otelconf/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
"go.opentelemetry.io/contrib/otelconf/internal/provider"
2424
)
2525

26+
const envVarConfigFile = "OTEL_EXPERIMENTAL_CONFIG_FILE"
27+
2628
// SDK is a struct that contains all the providers
2729
// configured via the configuration model.
2830
type SDK struct {
@@ -78,7 +80,7 @@ func parseConfigFileFromEnvironment(filename string) (ConfigurationOption, error
7880
// NewSDK creates SDK providers based on the configuration model. It checks the local environment and
7981
// uses the file set in the variable `OTEL_EXPERIMENTAL_CONFIG_FILE` to configure the SDK automatically.
8082
func NewSDK(opts ...ConfigurationOption) (SDK, error) {
81-
filename, ok := os.LookupEnv("OTEL_EXPERIMENTAL_CONFIG_FILE")
83+
filename, ok := os.LookupEnv(envVarConfigFile)
8284
if ok {
8385
opt, err := parseConfigFileFromEnvironment(filename)
8486
if err != nil {
File renamed without changes.

0 commit comments

Comments
 (0)