Use external spinsult pkg

This commit is contained in:
Russ Magee 2026-02-23 18:50:02 -08:00
parent 36f6684f4f
commit 3552c415dc
7 changed files with 15 additions and 145 deletions

View File

@ -34,7 +34,7 @@ GIT_COMMIT := $(shell git rev-list -1 HEAD)
BUILDOPTS :=$(BUILDOPTS)"$(GOBUILDOPTS) -ldflags \"-X main.version=$(VERSION)$(MTAG)$(VTAG) -X main.gitCommit=$(GIT_COMMIT)\""
#endif
SUBPKGS = logger spinsult xsnet
SUBPKGS = logger xsnet
TOOLS = xs xsd
SUBDIRS = $(LIBS) $(TOOLS)

9
go.mod
View File

@ -2,8 +2,6 @@ module blitter.com/go/xs
go 1.24.0
toolchain go1.24.11
require (
blitter.com/go/cryptmt v1.0.3
blitter.com/go/goutmp v1.0.6
@ -11,6 +9,7 @@ require (
blitter.com/go/hopscotch v0.3.0
blitter.com/go/kyber v1.0.0
blitter.com/go/newhope v1.0.0
blitter.com/go/spinsult v0.0.0-20260224023031-2afae6bbe758
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da
github.com/creack/pty v1.1.24
github.com/jameskeane/bcrypt v0.0.0-20120420032655-c3cd44c1e20f
@ -18,8 +17,8 @@ require (
github.com/kuking/go-frodokem v1.0.2
github.com/mattn/go-isatty v0.0.20
github.com/xtaci/kcp-go v4.3.4+incompatible
golang.org/x/crypto v0.47.0
golang.org/x/sys v0.40.0
golang.org/x/crypto v0.48.0
golang.org/x/sys v0.41.0
gopkg.in/hlandau/passlib.v1 v1.0.11
)
@ -32,7 +31,7 @@ require (
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect
github.com/tjfoc/gmsm v1.4.1 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/net v0.49.0 // indirect
gopkg.in/hlandau/easymetric.v1 v1.0.0 // indirect
gopkg.in/hlandau/measurable.v1 v1.0.1 // indirect
)

14
go.sum
View File

@ -14,6 +14,8 @@ blitter.com/go/mtwist v1.0.2 h1:4zmpKNynrRuFF8JAPdhBN8TaJB+quU5d2i7KBgFtVng=
blitter.com/go/mtwist v1.0.2/go.mod h1:Y/0x0EsFMUKK1+tdkoCW7H88eF7CTOycUMsTHcfCoZE=
blitter.com/go/newhope v1.0.0 h1:oUn35Ei30AGmLeqjNIG6DA7YNaK7fncBx4ptTnNrzmo=
blitter.com/go/newhope v1.0.0/go.mod h1:ywoxfDBqInPsqtnxYsmS4SYMJ5D/kNcrFgpvI+Xcun0=
blitter.com/go/spinsult v0.0.0-20260224023031-2afae6bbe758 h1:6CYxkKMXehsanwg0/G4q1K/+M+pYhfcv49ngfsmLtyk=
blitter.com/go/spinsult v0.0.0-20260224023031-2afae6bbe758/go.mod h1:/EchWRYRoJvzxpR6Pt6tSpQ9X4bjhF4BOppXYsZa16I=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
@ -80,8 +82,8 @@ golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@ -92,8 +94,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -104,8 +106,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190902133755-9109b7679e13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

View File

@ -1,24 +0,0 @@
.PHONY: info clean lib
ifeq ($(GARBLE),y)
GO = garble -literals -tiny -debugdir=garbled
else
GO = go
endif
all: lib
clean:
go clean .
lib: info
$(GO) build .
go install .
ifneq ($(MSYSTEM),)
info:
@echo "Building for Windows (MSYS)"
else
info:
@echo "Building for Linux"
endif

View File

@ -1,55 +0,0 @@
// A golang translation of a 'Shakespeare insult generator'
// Originally from http://www.mainstrike.com/mstservices/handy/insult.html
package spinsult
import (
"math/rand"
"time"
)
var (
r *rand.Rand
phrase1 = [...]string{
"artless", "bawdy", "beslubbering", "bootless", "churlish", "clouted",
"cockered", "craven", "currish", "dankish", "dissembling", "droning", "errant", "fawning",
"fobbing", "frothy", "froward", "gleeking", "goatish", "gorbellied", "impertinent",
"infectious", "jarring", "loggerheaded", "lumpish", "mammering", "mangled", "mewling",
"paunchy", "pribbling", "puking", "puny", "qualling", "rank", "reeky", "roguish", "ruttish",
"saucy", "spleeny", "spongy", "surly", "tottering", "unmuzzled", "vain", "venomed",
"villainous", "warped", "wayward", "weedy", "yeasty"}
phrase2 = [...]string{"base-court", "bat-fowling", "beef-witted", "beetle-headed",
"boil-brained", "clapper-clawed", "clay-brained", "common-kissing", "crook-pated",
"dismal-dreaming", "dizzy-eyed", "doghearted", "dread-bolted", "earth-vexing",
"elf-skinned", "fat-kidneyed", "fen-sucked", "flap-mouthed", "fly-bitten",
"folly-fallen", "fool-born", "full-gorged", "guts-griping", "half-faced", "hasty-witted",
"hedge-born", "hell-hated", "idle-headed", "ill-breeding", "ill-nurtured", "knotty-pated",
"milk-livered", "motley-minded", "onion-eyed", "plume-plucked", "pottle-deep",
"pox-marked", "reeling-ripe", "rough-hewn", "rude-growing", "rump-fed", "shard-borne",
"sheep-biting", "spur-galled", "swag-bellied", "tardy-gaited", "tickle-brained",
"toad-spotted", "urchin-snouted", "weather-bitten"}
phrase3 = [...]string{"apple-john", "baggage", "barnacle", "bladder", "boar-pig", "bugbear",
"bum-bailey", "canker-blossom", "clack-dish", "clotpole", "codpiece", "coxcomb", "death-token",
"dewberry", "flap-dragon", "flax-wench", "flirt-gill", "foot-licker", "fustilarian",
"giglet", "gudgeon", "haggard", "harpy", "hedge-pig", "horn-beast", "hugger-mugger",
"joithead", "lewdster", "lout", "maggot-pie", "malt-worm", "mammet", "measle", "minnow",
"miscreant", "moldwarp", "mumble-news", "nut-hook", "pigeon-egg", "pignut", "pumpion",
"puttock", "ratsbane", "scut", "skainsmate", "strumpet", "varlet", "vassal", "wagtail",
"whey-face"}
)
func GetSentence() (ret string) {
return "Thou " + Get()
}
func Get() (ret string) {
if r == nil {
r = rand.New(rand.NewSource(time.Now().UnixNano()))
}
ret = phrase1[r.Int()%len(phrase1)] + " " +
phrase2[r.Int()%len(phrase2)] + " " +
phrase3[r.Int()%len(phrase3)] + "!"
return
}

View File

@ -1,52 +0,0 @@
//To show coverage for tests:
//
//1. go test -coverprofile=cov.out
//2. go tool cover -func=cov.out
//3. go tool cover -html=cov.out
//4. Profit!!
//
// For heatmap coverage, change step 1 to:
//2. go test -covermode=count -coverprofile=cov.out
//
// ref: https://blog.golang.org/cover
package spinsult
import (
"fmt"
"math/rand"
"testing"
)
func Test1Get(t *testing.T) {
//if testing.Short() {
// t.Skip("skipping test in short mode.")
//}
r = rand.New(rand.NewSource(42))
out := Get()
if out != "mammering doghearted codpiece!" {
t.Fail()
}
}
func Test2Get(t *testing.T) {
//if testing.Short() {
// t.Skip("skipping test in short mode.")
//}
out := Get()
if out != "dankish common-kissing coxcomb!" {
t.Fail()
}
out = GetSentence()
if out != "Thou wayward crook-pated fustilarian!" {
t.Fail()
}
}
// Example of calling Get() for a random insult.
func ExampleGet() {
r = rand.New(rand.NewSource(42))
out := GetSentence()
fmt.Println(out)
//Output: Thou mammering doghearted codpiece!
}

View File

@ -33,7 +33,7 @@ import (
xs "blitter.com/go/xs"
"blitter.com/go/xs/logger"
"blitter.com/go/xs/spinsult"
"blitter.com/go/spinsult"
"blitter.com/go/xs/xsnet"
"github.com/mattn/go-isatty"
//isatty "github.com/mattn/go-isatty"
@ -600,7 +600,7 @@ func usageCp() {
//
// TODO: do this from the server side and have client just emit that
func rejectUserMsg() string {
return "Begone, " + spinsult.GetSentence() + "\r\n"
return "Begone, thou " + spinsult.Get() + "!\r\n"
}
// Transmit request to server for it to set up the remote end of a tunnel