From e081f7e583388462c8370b513d3511443aa8c754 Mon Sep 17 00:00:00 2001 From: Anton Ovchinnikov Date: Mon, 9 Jan 2023 11:53:59 +0100 Subject: [PATCH] ref: Rename example/ directory to _examples/ (#521) --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 8 ++++---- {example => _examples}/basic/main.go | 0 {example => _examples}/echo/main.go | 0 {example => _examples}/fasthttp/main.go | 0 {example => _examples}/feature-showcase/main.go | 0 {example => _examples}/flush/main.go | 0 {example => _examples}/gin/main.go | 0 {example => _examples}/http/main.go | 0 {example => _examples}/iris/main.go | 0 {example => _examples}/logrus/main.go | 0 {example => _examples}/martini/main.go | 0 {example => _examples}/multiclient/main.go | 0 {example => _examples}/negroni/main.go | 0 {example => _examples}/recover-repanic/main.go | 0 {example => _examples}/recover/main.go | 0 {example => _examples}/synctransport/main.go | 0 {example => _examples}/with_extra/main.go | 0 doc.go | 2 +- echo/README.md | 2 +- fasthttp/README.md | 2 +- gin/README.md | 2 +- go.mod | 1 - go.sum | 2 -- http/README.md | 2 +- http/example_test.go | 2 +- iris/README.md | 2 +- martini/README.md | 2 +- negroni/README.md | 2 +- 29 files changed, 14 insertions(+), 17 deletions(-) rename {example => _examples}/basic/main.go (100%) rename {example => _examples}/echo/main.go (100%) rename {example => _examples}/fasthttp/main.go (100%) rename {example => _examples}/feature-showcase/main.go (100%) rename {example => _examples}/flush/main.go (100%) rename {example => _examples}/gin/main.go (100%) rename {example => _examples}/http/main.go (100%) rename {example => _examples}/iris/main.go (100%) rename {example => _examples}/logrus/main.go (100%) rename {example => _examples}/martini/main.go (100%) rename {example => _examples}/multiclient/main.go (100%) rename {example => _examples}/negroni/main.go (100%) rename {example => _examples}/recover-repanic/main.go (100%) rename {example => _examples}/recover/main.go (100%) rename {example => _examples}/synctransport/main.go (100%) rename {example => _examples}/with_extra/main.go (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a177e525..c069f9b5a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,7 +99,7 @@ jobs: run: | # Iris requires Module mode, therefore we delete the relevant code to # skip testing it in GOPATH mode. - rm -vrf ./iris/ ./example/iris/ + rm -vrf ./iris/ ./_examples/iris/ - name: Download Dependencies run: go get -d -t -v ./... - name: Build diff --git a/CHANGELOG.md b/CHANGELOG.md index ae9a6c29e..ca66fa510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,10 +18,10 @@ Due to ongoing work towards a stable API for `v1.0.0`, we sadly had to include * ``` - Unify TracesSampler [#498](https://github.com/getsentry/sentry-go/pull/498) - `TracesSampler` was changed to a callback that must return a `float64` between `0.0` and `1.0`. - + For example, you can apply a sample rate of `1.0` (100%) to all `/api` transactions, and a sample rate of `0.5` (50%) to all other transactions. You can read more about this in our [SDK docs](https://docs.sentry.io/platforms/go/configuration/filtering/#using-sampling-to-filter-transaction-events). - + ```go sentry.Init(sentry.ClientOptions{ TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 { @@ -40,7 +40,7 @@ Due to ongoing work towards a stable API for `v1.0.0`, we sadly had to include * ### Features - Send errors logged with [Logrus](https://github.com/sirupsen/logrus) to Sentry. - - Have a look at our [logrus examples](https://github.com/getsentry/sentry-go/blob/master/example/logrus/main.go) on how to use the integration. + - Have a look at our [logrus examples](https://github.com/getsentry/sentry-go/blob/master/_examples/logrus/main.go) on how to use the integration. - Add support for Dynamic Sampling [#491](https://github.com/getsentry/sentry-go/pull/491) - You can read more about Dynamic Sampling in our [product docs](https://docs.sentry.io/product/data-management-settings/dynamic-sampling/). - Add detailed logging about the reason transactions are being dropped. @@ -128,7 +128,7 @@ There are no breaking changes and upgrading should be a smooth experience for al _NOTE:_ This version introduces support for [Sentry's Performance Monitoring](https://docs.sentry.io/platforms/go/performance/). The new tracing capabilities are beta, and we plan to expand them on future versions. Feedback is welcome, please open new issues on GitHub. -The `sentryhttp` package got better API docs, an [updated usage example](https://github.com/getsentry/sentry-go/tree/master/example/http) and support for creating automatic transactions as part of Performance Monitoring. +The `sentryhttp` package got better API docs, an [updated usage example](https://github.com/getsentry/sentry-go/tree/master/_examples/http) and support for creating automatic transactions as part of Performance Monitoring. ## v0.8.0 diff --git a/example/basic/main.go b/_examples/basic/main.go similarity index 100% rename from example/basic/main.go rename to _examples/basic/main.go diff --git a/example/echo/main.go b/_examples/echo/main.go similarity index 100% rename from example/echo/main.go rename to _examples/echo/main.go diff --git a/example/fasthttp/main.go b/_examples/fasthttp/main.go similarity index 100% rename from example/fasthttp/main.go rename to _examples/fasthttp/main.go diff --git a/example/feature-showcase/main.go b/_examples/feature-showcase/main.go similarity index 100% rename from example/feature-showcase/main.go rename to _examples/feature-showcase/main.go diff --git a/example/flush/main.go b/_examples/flush/main.go similarity index 100% rename from example/flush/main.go rename to _examples/flush/main.go diff --git a/example/gin/main.go b/_examples/gin/main.go similarity index 100% rename from example/gin/main.go rename to _examples/gin/main.go diff --git a/example/http/main.go b/_examples/http/main.go similarity index 100% rename from example/http/main.go rename to _examples/http/main.go diff --git a/example/iris/main.go b/_examples/iris/main.go similarity index 100% rename from example/iris/main.go rename to _examples/iris/main.go diff --git a/example/logrus/main.go b/_examples/logrus/main.go similarity index 100% rename from example/logrus/main.go rename to _examples/logrus/main.go diff --git a/example/martini/main.go b/_examples/martini/main.go similarity index 100% rename from example/martini/main.go rename to _examples/martini/main.go diff --git a/example/multiclient/main.go b/_examples/multiclient/main.go similarity index 100% rename from example/multiclient/main.go rename to _examples/multiclient/main.go diff --git a/example/negroni/main.go b/_examples/negroni/main.go similarity index 100% rename from example/negroni/main.go rename to _examples/negroni/main.go diff --git a/example/recover-repanic/main.go b/_examples/recover-repanic/main.go similarity index 100% rename from example/recover-repanic/main.go rename to _examples/recover-repanic/main.go diff --git a/example/recover/main.go b/_examples/recover/main.go similarity index 100% rename from example/recover/main.go rename to _examples/recover/main.go diff --git a/example/synctransport/main.go b/_examples/synctransport/main.go similarity index 100% rename from example/synctransport/main.go rename to _examples/synctransport/main.go diff --git a/example/with_extra/main.go b/_examples/with_extra/main.go similarity index 100% rename from example/with_extra/main.go rename to _examples/with_extra/main.go diff --git a/doc.go b/doc.go index f80fd4024..5e6830880 100644 --- a/doc.go +++ b/doc.go @@ -18,7 +18,7 @@ Sentry project. This step is accomplished through a call to sentry.Init. } A more detailed yet simple example is available at -https://github.com/getsentry/sentry-go/blob/master/example/basic/main.go. +https://github.com/getsentry/sentry-go/blob/master/_examples/basic/main.go. # Error Reporting diff --git a/echo/README.md b/echo/README.md index eb8546f26..b089c810b 100644 --- a/echo/README.md +++ b/echo/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/echo -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/echo +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/echo ## Installation diff --git a/fasthttp/README.md b/fasthttp/README.md index 287e4e032..47e8675df 100644 --- a/fasthttp/README.md +++ b/fasthttp/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/fasthttp -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/fasthttp +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/fasthttp ## Installation diff --git a/gin/README.md b/gin/README.md index 59608eb9d..c504680f4 100644 --- a/gin/README.md +++ b/gin/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/gin -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/gin +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/gin ## Installation diff --git a/go.mod b/go.mod index dc63964d8..e96d2f37b 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/goccy/go-json v0.9.11 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/css v1.0.0 // indirect diff --git a/go.sum b/go.sum index e79988cc5..8ac9a2cc2 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,6 @@ github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= diff --git a/http/README.md b/http/README.md index d25935d4b..e18441472 100644 --- a/http/README.md +++ b/http/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/http -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/http +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/http ## Installation diff --git a/http/example_test.go b/http/example_test.go index be1c9a3a7..de8d256ac 100644 --- a/http/example_test.go +++ b/http/example_test.go @@ -8,7 +8,7 @@ import ( ) // For a longer and executable example, see -// https://github.com/getsentry/sentry-go/tree/master/example/http. +// https://github.com/getsentry/sentry-go/tree/master/_examples/http. func Example() { // Initialize the Sentry SDK once in the main function. // sentry.Init(...) diff --git a/iris/README.md b/iris/README.md index 9509c6eae..3e3fb7ad7 100644 --- a/iris/README.md +++ b/iris/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/iris -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/iris +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/iris ## Installation diff --git a/martini/README.md b/martini/README.md index 234cbbb54..0defaa42f 100644 --- a/martini/README.md +++ b/martini/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/martini -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/martini +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/martini ## Installation diff --git a/negroni/README.md b/negroni/README.md index cac730483..8fa94931c 100644 --- a/negroni/README.md +++ b/negroni/README.md @@ -9,7 +9,7 @@ **Godoc:** https://godoc.org/github.com/getsentry/sentry-go/negroni -**Example:** https://github.com/getsentry/sentry-go/tree/master/example/negroni +**Example:** https://github.com/getsentry/sentry-go/tree/master/_examples/negroni ## Installation