Go code to parse IAB v1/v2 consent based on github.com/LiveRamp/iabconsent library.
This package is just a wrapper on their amazing work to fill our needs.
go get github.com/affectv/iab-tcf
package main
import (
"fmt"
iab "github.com/affectv/iab-tcf"
)
func main() {
encoded := "COyt4MbOyt4MbMOAAAENAiCgAIAAAAAAAAAAADEAAgIAAAAAAAA.YAAAAAAAAAA"
consent, err := iab.NewConsent(encoded)
}
We use Ginkgo and Gomega for testing purposes.
ginkgo ./...