https://github.com/pactflow/example-consumer-golang
Example consumer with Golang
https://github.com/pactflow/example-consumer-golang
example
Last synced: 9 months ago
JSON representation
Example consumer with Golang
- Host: GitHub
- URL: https://github.com/pactflow/example-consumer-golang
- Owner: pactflow
- License: mit
- Created: 2021-01-11T12:21:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-21T01:28:22.000Z (9 months ago)
- Last Synced: 2025-04-30T03:44:37.981Z (9 months ago)
- Topics: example
- Language: Makefile
- Size: 10.4 MB
- Stars: 1
- Watchers: 10
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Consumer


This is an example of a Golang consumer using Pact to create a consumer driven contract, and sharing it via [PactFlow](https://pactflow.io).
It is using a public tenant on PactFlow, which you can access [here](https://test.pactflow.io) using the credentials `dXfltyFMgNOFZAxr8io9wJ37iUpY42M`/`O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1`. The latest version of the Example Consumer/Example Provider pact is published [here](https://test.pactflow.io/pacts/provider/pactflow-example-provider-golang/consumer/pactflow-example-consumer-golang/latest).
The project uses a Makefile to simulate a very simple build pipeline with two stages - test and deploy.
* Test
* Run tests (including the pact tests that generate the contract)
* Publish pacts, tagging the consumer version with the name of the current branch
* Check if we are safe to deploy to prod (ie. has the pact content been successfully verified)
* Deploy (only from master)
* Deploy app (just pretend for the purposes of this example!)
* Tag the deployed consumer version as 'prod'
## Usage
See the [PactFlow CI/CD Workshop](https://github.com/pactflow/ci-cd-workshop) for background.