trunk
nate smith 2024-09-01 15:17:13 -05:00
parent 7b9ccf0ff2
commit b3294e880f
4 changed files with 4 additions and 13 deletions

View File

@ -3,7 +3,6 @@ package main
import (
"errors"
"fmt"
"math/rand"
"os"
"os/user"
"path"
@ -71,8 +70,6 @@ func validExec(execPath string) error {
}
func submit(opts *contribOpts) error {
rand.Seed(time.Now().UTC().UnixNano())
var cmdName string
var category string
var shortDesc string

View File

@ -153,8 +153,6 @@ func _main() error {
r := newReviewer(signupDB, u.Username)
rand.Seed(time.Now().Unix())
su := models.TownSignup{}
signups, err := su.All(signupDB)
@ -437,7 +435,8 @@ func _main() error {
if exiterr, ok := err.(*exec.ExitError); ok {
// no match or interrupt. who cares
switch exiterr.ExitCode() {
case 1: case 130:
case 1:
case 130:
return
}
}

View File

@ -3,13 +3,11 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/charmbracelet/glamour"
@ -39,7 +37,6 @@ func main() {
}
func visitRandomUser() error {
rand.Seed(time.Now().UnixNano())
usernames, err := getUsernames()
if err != nil {
return err
@ -78,7 +75,7 @@ func visitPrompt() error {
}
func visitUser(username string) error {
files, err := ioutil.ReadDir(filepath.Join("/home", username))
files, err := os.ReadDir(filepath.Join("/home", username))
if err != nil {
return fmt.Errorf("user is not accepting visitors (could not read user's home directory: %w)", err)
}
@ -90,7 +87,7 @@ func visitUser(username string) error {
path := filepath.Join("/home", username, file.Name())
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if err != nil {
break
}

View File

@ -12,7 +12,6 @@ import (
"os/user"
"path/filepath"
"syscall"
"time"
email "git.tilde.town/tildetown/town/email"
)
@ -178,7 +177,6 @@ if you did _not_ request this, please let an admin know.
}
func genGiteaPassword() string {
rand.Seed(time.Now().UnixNano())
b := make([]byte, 20)
for i := range b {
b[i] = pwLetters[rand.Intn(len(pwLetters))]