segmentio / ksuid

K-Sortable Globally Unique IDs
https://segment.com/blog/a-brief-history-of-the-uuid/
MIT License
4.82k stars 174 forks source link

cmd template should use text/template to avoid escaping #37

Closed tmthrgd closed 5 years ago

tmthrgd commented 5 years ago

The ksuid command uses html/template here instead of text/template. html/template escapes the output and corrupts it.

This is the result of running the ksuid command:

$ ksuid -f template -t '{{ .Time }}: {{ .Payload }}' $(ksuid)
2018-10-17 00:04:57 +1030 ACDT: 956449DBD1047A4E0F7963973073EEF2

+ should be +.

achille-roussel commented 5 years ago

You’re correct, this looks like an oversight.

Would you be able to send a pull request to fix the issue?