Skip to content

Latest commit

 

History

History
 
 

go

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.