-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrintDAG should take either a PrinterFunc or a buffer #14
Comments
Alternatively the function could just return a string, however, then it would probably need a name change to something like |
That function is not really used (I used it mostly for debugging at the beginning). It doesn't even work very well (printing a multi-branched DAG is pretty horrible). I'm happy changing it to whatever fits your needs. Would you like to make a PR? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The PrintDAG should take either a PrinterFunc(line string) as an argument, or an io.Writer so you can control what the function prints to. I noticed the comments on the PrintDAG function even mention a printerFunc.
Might be a small niche use-case but as an experimental use of the crdt Datastore I've made an HTTP server that takes a go-datastore interface and exposes a basic API, it would be nice to be able to print the DAG and return it over the API. At the moment my only options are using my own fork that implements one of these two options, or some janky stdout copy/buffer stuff (don't want to do).
Thoughts?
The text was updated successfully, but these errors were encountered: