feat: move remaining go scripts to main executable
This commit is contained in:
parent
4e056632c8
commit
7c7f948ad6
3 changed files with 59 additions and 5 deletions
|
@ -1,12 +1,20 @@
|
|||
package main
|
||||
package genkey
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var Command = &cli.Command{
|
||||
Name: "key",
|
||||
Usage: "Generate a secure 64-byte base 64 key",
|
||||
Action: run,
|
||||
}
|
||||
|
||||
func run(c *cli.Context) error {
|
||||
b := make([]byte, 64)
|
||||
|
||||
_, err := rand.Read(b)
|
||||
|
@ -17,4 +25,5 @@ func main() {
|
|||
s := base64.URLEncoding.EncodeToString(b)
|
||||
|
||||
fmt.Println(s)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue