Skip to content

Commit

Permalink
docs: --ignore-tp-env replace field to --tp-ignore-env (#147)
Browse files Browse the repository at this point in the history
refactor: replace deprecated file reader method

Signed-off-by: Gokhan Karadas <[email protected]>
Co-authored-by: Gokhan Karadas <[email protected]>
  • Loading branch information
previousdeveloper and Gokhan Karadas authored Jan 31, 2023
1 parent dd33e47 commit 72df644
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ otel-cli exec --service my-service --name "curl google" curl https://google.com
otel-cli exec --kind producer "otel-cli exec --kind consumer sleep 1"

# if a traceparent envvar is set it will be automatically picked up and
# used by span and exec. use --ignore-tp-env to ignore it even when present
# used by span and exec. use --tp-ignore-env to ignore it even when present
export TRACEPARENT=00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01

# create a span with a custom start/end time using either RFC3339,
Expand Down
3 changes: 1 addition & 2 deletions otelcli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package otelcli

import (
"encoding/json"
"io/ioutil"
"os"
"reflect"
"strconv"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (c *Config) LoadFile() error {
return nil
}

js, err := ioutil.ReadFile(config.CfgFile)
js, err := os.ReadFile(config.CfgFile)
if err != nil {
return errors.Wrapf(err, "failed to read file '%s'", c.CfgFile)
}
Expand Down
2 changes: 1 addition & 1 deletion otelcli/otelclicarrier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestWriteTraceparentToFile(t *testing.T) {
saveTraceparentToFile(ctx, file.Name())

// read the data back, it should just be the traceparent string
data, err := ioutil.ReadFile(file.Name())
data, err := os.ReadFile(file.Name())
if err != nil {
t.Fatalf("failed to read tempfile '%s': %s", file.Name(), err)
}
Expand Down
2 changes: 1 addition & 1 deletion otelcli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Example:
}

// StatusOutput captures all the data we want to print out for this subcommand
// and is also is used in ../main_test.go for automated testing.
// and is also used in ../main_test.go for automated testing.
type StatusOutput struct {
Config Config `json:"config"`
SpanData map[string]string `json:"span_data"`
Expand Down

0 comments on commit 72df644

Please sign in to comment.