Skip to content

Commit

Permalink
Bump CI default version of Go to 1.20 (#3396)
Browse files Browse the repository at this point in the history
* Bump default ver Go 1.20 in CI

* Remove use of dep rand.Seed in otelsarama example

* Add PR number to changelog

---------

Co-authored-by: Chester Cheung <[email protected]>
  • Loading branch information
MrAlias and hanyuancheung committed Feb 20, 2023
1 parent de47366 commit e31186a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit e31186a

Please sign in to comment.