move a few tools to a more central utility cli

This commit is contained in:
adman
2026-03-18 20:45:54 +01:00
parent e0cf1834f1
commit f554e91354
6 changed files with 94 additions and 20 deletions
+2
View File
@@ -8,6 +8,7 @@ import (
)
// Connect connects to the given address note that it does not resolve the SRV records it's just a raw net.Dial
// You must close the connection when you're done with it
func Connect(addr string) (ret *proto.Conn, err error) {
s, err := Status(addr)
if err != nil {
@@ -23,6 +24,7 @@ func Connect(addr string) (ret *proto.Conn, err error) {
// ConnectVersionLess connects to the given address without setting the version you should set it
// when using this function.
// You must close the connection when you're done with it
func ConnectVersionLess(addr string) (ret *proto.Conn, err error) {
ret = &proto.Conn{}
ret.SetState(proto_base.Handshaking)
+1 -1
View File
@@ -53,6 +53,7 @@ func StatusRaw(addr string) (s *StatusClient, err error) {
if err != nil {
return
}
defer c.Close()
err = c.SetVersion("1.21.8")
if err != nil {
return
@@ -61,7 +62,6 @@ func StatusRaw(addr string) (s *StatusClient, err error) {
Conn: c,
}
err = s.Start(s)
defer c.Close()
return
}