Files
fn-serverless/examples/tutorial/logging/main.go
Reed Allman 1cdb47d6e9 server, examples, extensions lint compliant (#1109)
these are all automated changes suggested by golint
2018-07-04 15:23:15 +01:00

29 lines
479 B
Go

package main
import (
"encoding/json"
"fmt"
"math/rand"
"os"
)
const lBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
type outputSize struct {
Size int `json:"size"`
}
func randStringBytes(n int) string {
b := make([]byte, n)
for i := range b {
b[i] = lBytes[rand.Intn(len(lBytes))]
}
return string(b)
}
func main() {
out := &outputSize{Size: 64 * 1024}
json.NewDecoder(os.Stdin).Decode(out)
fmt.Fprintln(os.Stderr, randStringBytes(out.Size))
}