https://github.com/teamwork/asbyte
Print data as Go byte slices
https://github.com/teamwork/asbyte
go
Last synced: about 1 year ago
JSON representation
Print data as Go byte slices
- Host: GitHub
- URL: https://github.com/teamwork/asbyte
- Owner: Teamwork
- License: mit
- Created: 2018-11-26T06:09:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-26T06:10:15.000Z (over 7 years ago)
- Last Synced: 2025-01-09T09:49:24.927Z (about 1 year ago)
- Topics: go
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 46
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A simple program to print data as Go byte slices.
Why? Because I couldn't figure out how to do this with `hexdump` or `xxd`, and
the last 3 times I spent far too long parsing the `hexdump` output with Vim
macros/substitution patterns.
Usage example (output elided):
$ go get github.com/teamwork/asbyte
$ asbyte a.*
// nolint: lll
var (
a_gif = []byte{0x47, 0x49, 0x46, 0x38, ...}
a_jpeg = []byte{0xff, 0xd8, 0xff, 0xe0, ...}
a_png = []byte{0x89, 0x50, 0x4e, 0x47, 0xd, ...}
)