This commit is contained in:
Neale Pickett 2019-02-25 16:07:53 +00:00
parent dc4fa96f9e
commit 628d8a0b05
3 changed files with 11 additions and 14 deletions

View File

@ -297,4 +297,3 @@ func (ctx *Instance) BindHandlers() {
ctx.mux.HandleFunc(ctx.Base+"/puzzles.json", ctx.puzzlesHandler) ctx.mux.HandleFunc(ctx.Base+"/puzzles.json", ctx.puzzlesHandler)
ctx.mux.HandleFunc(ctx.Base+"/points.json", ctx.pointsHandler) ctx.mux.HandleFunc(ctx.Base+"/points.json", ctx.pointsHandler)
} }

View File

@ -6,12 +6,12 @@ import (
"io" "io"
"io/ioutil" "io/ioutil"
"log" "log"
"math/rand"
"net/http" "net/http"
"os" "os"
"path" "path"
"strings" "strings"
"time" "time"
"math/rand"
) )
type Instance struct { type Instance struct {
@ -56,7 +56,7 @@ const distinguishableChars = "234678abcdefhijkmnpqrtwxyz="
func mktoken() string { func mktoken() string {
a := make([]byte, 8) a := make([]byte, 8)
for i := range(a) { for i := range a {
char := rand.Intn(len(distinguishableChars)) char := rand.Intn(len(distinguishableChars))
a[i] = distinguishableChars[char] a[i] = distinguishableChars[char]
} }

View File

@ -3,19 +3,17 @@ package main
import ( import (
"github.com/namsral/flag" "github.com/namsral/flag"
"log" "log"
"math/rand"
"mime" "mime"
"net/http" "net/http"
"time" "time"
"math/rand"
) )
func setup() error { func setup() error {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
return nil return nil
} }
func main() { func main() {
base := flag.String( base := flag.String(
"base", "base",