Working some things out
This commit is contained in:
@@ -23,6 +23,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
|
||||
"github.com/gdamore/tcell"
|
||||
@@ -116,3 +117,13 @@ func (ui *Ui) SetScreen(scr *UiScreen) {
|
||||
|
||||
func (ui *Ui) stop() { ui.running = false }
|
||||
func (ui *Ui) cleanup() { ui.tScreen.Fini() }
|
||||
|
||||
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
func RandomString(n int) string {
|
||||
b := make([]byte, n)
|
||||
for i := range b {
|
||||
b[i] = letters[rand.Intn(len(letters))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user