tree: b30bfaf9523f50f2256207e30ed0b4049d013ecb [path history] [tgz]
  1. checks/
  2. dpagg/
  3. noise/
  4. rand/
  5. .bazelversion
  6. BUILD.bazel
  7. go.mod
  8. go.sum
  9. go_differential_privacy_deps.bzl
  10. README.md
  11. WORKSPACE
go/README.md

Differential Privacy in Go

This is the Go implementation of the differential privacy library. For general details and key definitions, see the top-level documentation. This document describes Go-specific aspects.

How to Use

Usage of the Go Differential Privacy library is demonstrated in the codelab.

Full documentation of the API is available as godoc.

Using with the “go” Command

For building the differential privacy library with the “go” command, you can run the following:

go build -mod=mod ./...

This will build all the packages. -mod=mod is necessary for installing all the dependencies automatically. Otherwise, you'll be asked to install each dependency manually.

Similarly, you can run all the tests with:

go test -mod=mod ./...

If you already built the code with go build, you can omit -mod=mod.

If you wish to run the codelab, you can do so by (from the root of the repository):

cd examples/go/main
go run -mod=mod . -scenario=CountVisitsPerHour -input_file=../data/day_data.csv -non_private_output_file=out1.csv -private_output_file=out2.csv

Change scenario and input_file to run other scenarios. Check out the README for more information.