Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-1660: Organise Examples #140

Merged
merged 6 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
examples/profile/images/YotiSelfie.jpeg
.vscode

# Test binary, build with `go test -c`
*.test

# Example project generated self-signed certificate
examples/profile/yotiSelfSignedCert.pem
examples/profile/yotiSelfSignedKey.pem

# Key generated in test
cryptoutil/tmpKey.pem

Expand All @@ -19,4 +14,4 @@ sonar-report.json
coverage.out

# idea files
.idea
.idea
17 changes: 10 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@ repos:
language: 'script'
description: "Go Format"

- id: local-tidy
- id: local-go-build-modtidy
name: 'go build & go mod tidy'
entry: sh/go-build-modtidy.sh
language: 'script'
description: "Go build & go mod tidy"

- id: local-go-imports
name: 'tidy imports'
entry: sh/tidy.sh
entry: sh/goimports.sh
language: 'script'
description: "Tidy imports"
description: "Go imports"

- repo: git://github.com/dnephin/pre-commit-golang
rev: master
hooks:
- id: go-vet
exclude: "examples/"
- id: go-build
args: ["./..."]
exclude: _examples
- id: go-cyclo
args: [-over=15]
- id: golangci-lint
args: ["-e", "SA1019"]
- id: go-mod-tidy
- id: go-unit-tests
args: ["-race", "./..."]
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For developing in VS Code, use the following `launch.json` file (placed inside a
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/examples/aml/main.go"
"program": "${workspaceFolder}/_examples/aml/main.go"
},
{
"name": "Example",
Expand All @@ -29,7 +29,7 @@ For developing in VS Code, use the following `launch.json` file (placed inside a
"mode": "debug",
"remotePath": "",
"host": "127.0.0.1",
"program": "${workspaceFolder}/examples/profile/main.go",
"program": "${workspaceFolder}/_examples/profile/main.go",
"env": {},
"args": ["certificatehelper.go"],
"showLog": true
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ The `profile` object provides a set of attributes corresponding to user attribut

## Sandbox

See [examples/profilesandbox](examples/profilesandbox) for information about how to use the Yoti Profile Sandbox service.
See [_examples/profilesandbox](_examples/profilesandbox) for information about how to use the Yoti Profile Sandbox service.

## AML Integration

Expand Down Expand Up @@ -293,22 +293,22 @@ log.Printf(
}
```

Additionally, an [example AML application](/examples/aml/main.go) is provided in the examples folder.
Additionally, an [example AML application](/_examples/aml/main.go) is provided in the `_examples` folder.

* Rename the [.env.example](examples/profile/.env.example) file to `.env` and fill in the required configuration values (mentioned in the [Configuration](#configuration) section)
* Change directory to the aml example folder: `cd examples/aml`
* Rename the [.env.example](_examples/profile/.env.example) file to `.env` and fill in the required configuration values (mentioned in the [Configuration](#configuration) section)
* Change directory to the aml example folder: `cd _examples/aml`
* Install the dependencies with `go get`
* Start the example with `go run main.go`

## Running the Profile Example

The profile retrieval example can be found in the [examples folder](examples).
The profile retrieval example can be found in the [_examples folder](_examples).

* Change directory to the profile example folder: `cd examples/profile`
* Change directory to the profile example folder: `cd _examples/profile`
* On the [Yoti Hub](https://hub.yoti.com/):
* Set the application domain of your app to `localhost:8080`
* Set the scenario callback URL to `/profile`
* Rename the [.env.example](examples/profile/.env.example) file to `.env` and fill in the required configuration values (mentioned in the [Configuration](#configuration) section)
* Rename the [.env.example](_examples/profile/.env.example) file to `.env` and fill in the required configuration values (mentioned in the [Configuration](#configuration) section)
* Install the dependencies with `go get`
* Start the server with `go run main.go certificatehelper.go`

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions _examples/aml/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module aml
davidgrayston marked this conversation as resolved.
Show resolved Hide resolved

go 1.12

require (
github.com/getyoti/yoti-go-sdk/v3 v3.0.0
github.com/joho/godotenv v1.3.0
)

replace github.com/getyoti/yoti-go-sdk/v3 => ../../
4 changes: 0 additions & 4 deletions examples/go.sum → _examples/aml/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github.com/getyoti/yoti-go-sdk v2.3.1+incompatible/go.mod h1:q+DK9jO6Ir6nyXmIYH6wwrWq47ibBqK62fhgLe4kqzo=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
Expand All @@ -15,8 +14,6 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -33,6 +30,5 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions _examples/profile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/images/YotiSelfie.jpeg

# Example project generated self-signed certificate
/yotiSelfSignedCert.pem
/yotiSelfSignedKey.pem
File renamed without changes.
10 changes: 10 additions & 0 deletions _examples/profile/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module profile
davidgrayston marked this conversation as resolved.
Show resolved Hide resolved

go 1.12

require (
github.com/getyoti/yoti-go-sdk/v3 v3.0.0
github.com/joho/godotenv v1.3.0
)

replace github.com/getyoti/yoti-go-sdk/v3 => ../../
34 changes: 34 additions & 0 deletions _examples/profile/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ The format of `privateKey` passed in to the client needs to be `*rsa.PrivateKey`

## Examples

- See [test_sandboxexample.go](test_sandboxexample.go) for a general example of how to use the Sandbox in your tests.
- See [test_sandboxanchorexample.go](test_sandboxanchorexample.go) for an example which sets up **anchor** expecations (see [source and verifiers](https://developers.yoti.com/yoti/knowledge-base-hub#source-and-verifiers)).
- See [sandboxexample_test.go](sandboxexample_test.go) for a general example of how to use the Sandbox in your tests.
- See [sandboxanchorexample_test.go](sandboxanchorexample_test.go) for an example which sets up **anchor** expecations (see [source and verifiers](https://developers.yoti.com/yoti/knowledge-base-hub#source-and-verifiers)).

To run the examples:
1. Copy the `.env.example` file and rename it to be `.env`.
1. Then modify the `YOTI_SANDBOX_CLIENT_SDK_ID` and `YOTI_KEY_FILE_PATH` environment variables mentioned above.

To make these tests runnable, the name needs to end in `_test.go`, so rename them accordingly.
4 changes: 2 additions & 2 deletions examples/go.mod → _examples/profilesandbox/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/getyoti/yoti-go-sdk/v3/examples
module profilesandbox
davidgrayston marked this conversation as resolved.
Show resolved Hide resolved

go 1.12

Expand All @@ -8,4 +8,4 @@ require (
gotest.tools/v3 v3.0.2
)

replace github.com/getyoti/yoti-go-sdk/v3 => ../
replace github.com/getyoti/yoti-go-sdk/v3 => ../../
34 changes: 34 additions & 0 deletions _examples/profilesandbox/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package profilesandbox

import (
"encoding/base64"
"log"
"os"
"testing"
"time"
Expand Down Expand Up @@ -55,16 +54,15 @@ func TestExample(t *testing.T) {
sandboxToken, err := sandboxClient.SetupSharingProfile(tokenRequest)
assert.NilError(t, err)

yotiClient := yoti.Client{
Key: pemFileBytes,
SdkID: sandboxClientSdkId,
}
yotiClient, err := yoti.NewClient(
sandboxClientSdkId,
pemFileBytes,
)
assert.NilError(t, err)
yotiClient.OverrideAPIURL("https://api.yoti.com/sandbox/v1")

activityDetails, err := yotiClient.GetActivityDetails(sandboxToken)
if len(err) > 0 {
log.Fatalf("%v", err)
}
assert.NilError(t, err)

// Test your application's logic here
assert.Equal(t, "some@email", activityDetails.UserProfile.EmailAddress().Value())
Expand Down
7 changes: 7 additions & 0 deletions sh/go-build-modtidy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
go build ./...

for d in _examples/*/
do
(cd "$d" && go mod tidy)
done
File renamed without changes.
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sonar.go.coverage.reportPaths = coverage.out
sonar.go.tests.reportPaths = sonar-report.json
sonar.tests = .
sonar.test.inclusions = **/*_test.go
sonar.coverage.exclusions = test/**/*,examples/**/*
sonar.coverage.exclusions = test/**/*,_examples/**/*