diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c40acb2e3..e05faf2e3e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,14 @@ on: env: # path to where test results will be saved TEST_RESULTS: /tmp/test-results - # Default minimum version of Go to support. - DEFAULT_GO_VERSION: 1.19 + # Default version of Go to use by CI workflows. This should be the latest + # release of Go; developers likely use the latest release in development and + # we want to catch any bugs (e.g. lint errors, race detection) with this + # release before they are merged. The Go compatibility guarantees ensure + # backwards compatibility with the previous two minor releases and we + # explicitly test our code for these versions so keeping this at prior + # versions does not add value. + DEFAULT_GO_VERSION: "1.20" jobs: lint: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbb8d27a28..29232bfe520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - `samplers/jaegerremote`: change to use protobuf parser instead of encoding/json to accept enums as strings. (#3183) +### Fixed + +- Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer`. (#3396) + ## [1.14.0/0.39.0/0.8.0] - 2023-02-07 ### Changed diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go index 68e742fda76..74bc63b89fd 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go @@ -62,18 +62,17 @@ func main() { log.Fatal(err) } - rand.Seed(time.Now().Unix()) - // Create root span tr := otel.Tracer("producer") ctx, span := tr.Start(context.Background(), "produce message") defer span.End() // Inject tracing info into message + rng := rand.New(rand.NewSource(time.Now().Unix())) msg := sarama.ProducerMessage{ Topic: example.KafkaTopic, Key: sarama.StringEncoder("random_number"), - Value: sarama.StringEncoder(fmt.Sprintf("%d", rand.Intn(1000))), + Value: sarama.StringEncoder(fmt.Sprintf("%d", rng.Intn(1000))), } otel.GetTextMapPropagator().Inject(ctx, otelsarama.NewProducerMessageCarrier(&msg))