Skip to content

Instantly share code, notes, and snippets.

Created Apr 12, 2018
What would you like to do?
package main
import (
func main() {
bs, err := ioutil.ReadAll(os.Stdin)
if err != nil {
b := new(strings.Builder)
fmt.Fprint(b, bs[0])
for _, c := range bs[1:] {
fmt.Fprintf(b, ", %d", c)
fmt.Printf("const bytes = new Uint8Array([%s]);", b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment