Skip to content

Conversation

@Lusitaniae
Copy link

@Lusitaniae Lusitaniae commented Jul 30, 2020

Solves #3

  1. Custom data type, it will hard code the provided string in case the data type is not supported by this tool or Faker.

  2. Add other data types, taken from this fork https://github.com/omnea/go-anonymize-mysqldump

There's a lot of copied code from the fork above, and seems they have they own fork of faker too.

May be worthwhile splitting the PR

@Lusitaniae
Copy link
Author

Would be nice to merge #7 too

@psociety
Copy link

psociety commented Aug 9, 2021

@Lusitaniae hi! Since this repo seems dead. How can i compile your fork?
i've tried go build command, but i get a:

go: cannot find main module, but found Gopkg.lock in /home/projects/go-anonymize-mysqldump-master
	to create a module there, run:
	go mod init

go version: go1.16.6 linux/amd64

I've tried setting go env -w GO111MODULE=auto (from golang/go#31997)
but then i get a:

anonymize-mysqldump.go:7:2: cannot find package "github.com/akamensky/argparse" in any of:
	/snap/go/7954/src/github.com/akamensky/argparse (from $GOROOT)
	/home/go/src/github.com/akamensky/argparse (from $GOPATH)
anonymize-mysqldump.go:8:2: cannot find package "github.com/sirupsen/logrus" in any of:
	/snap/go/7954/src/github.com/sirupsen/logrus (from $GOROOT)
	/home/go/src/github.com/sirupsen/logrus (from $GOPATH)
anonymize-mysqldump.go:9:2: cannot find package "github.com/xwb1989/sqlparser" in any of:
	/snap/go/7954/src/github.com/xwb1989/sqlparser (from $GOROOT)
	/home/go/src/github.com/xwb1989/sqlparser (from $GOPATH)
transformation-functions.go:5:2: cannot find package "syreclabs.com/go/faker" in any of:
	/snap/go/7954/src/syreclabs.com/go/faker (from $GOROOT)
	/home/go/src/syreclabs.com/go/faker (from $GOPATH)

Seems that manually installing them works:

go get github.com/akamensky/argparse
go get github.com/sirupsen/logrus
go get github.com/xwb1989/sqlparser
go get syreclabs.com/go/faker

Could CustomPhoneNumber take field length into account? your int field seems more useful than the generic fake numbers provided by the lib : o

@Lusitaniae
Copy link
Author

Haven't look in a while at this, possibly I also installed those libraries manually?

Will try to look into it later

Feel free to submit a PR to my repo, to add custom length parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants