]> 127.0.0.1 Git - forward/.git/commitdiff
1
authorqydysky <qydysky@foxmail.com>
Sun, 14 Apr 2024 15:14:42 +0000 (15:14 +0000)
committerqydysky <qydysky@foxmail.com>
Sun, 14 Apr 2024 15:14:42 +0000 (15:14 +0000)
go.mod
main_test.go

diff --git a/go.mod b/go.mod
index 4db32fd956cef39c7560a04b29783e5bd986dd15..098325394781df0f79bf70b195bb70fc3b197f5a 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,6 @@ require (
        github.com/andybalholm/brotli v1.1.0 // indirect
        github.com/davecgh/go-spew v1.1.1 // indirect
        github.com/go-ole/go-ole v1.3.0 // indirect
-       github.com/google/uuid v1.6.0 // indirect
        github.com/klauspost/compress v1.17.7 // indirect
        github.com/miekg/dns v1.1.58 // indirect
        github.com/pmezard/go-difflib v1.0.0 // indirect
index 46d3678efad82c3d4fd8f881a2adf5e8d92bde31..e9b090824149082c9e4d43054fda0598ee782510 100755 (executable)
@@ -4,17 +4,13 @@ import (
        "bufio"
        "context"
        "errors"
-       "fmt"
        "log"
        "net"
-       "net/http"
        "testing"
        "time"
 
        "github.com/qydysky/part"
        pctx "github.com/qydysky/part/ctx"
-       preqf "github.com/qydysky/part/reqf"
-       pweb "github.com/qydysky/part/web"
 )
 
 func Test(t *testing.T) {
@@ -107,9 +103,6 @@ func Test(t *testing.T) {
        if e := tcp2udpSer("127.0.0.1:20008", "127.0.0.1:20009"); e != nil {
                t.Fatal(e)
        }
-       if e := webSer("127.0.0.1:20008", "127.0.0.1:20009"); e != nil {
-               t.Fatal(e)
-       }
 }
 
 func tcpSer(lis, to string) error {
@@ -166,7 +159,7 @@ func tcpSer(lis, to string) error {
        if err != nil {
                return err
        }
-       conn.SetDeadline(time.Now().Add(time.Second))
+       _ = conn.SetDeadline(time.Now().Add(time.Second))
        // Send a message to the server
        _, err = conn.Write([]byte("Hello TCP Server\n"))
        if err != nil {
@@ -409,24 +402,3 @@ func tcp2udpSer(lis, to string) error {
                return nil
        }
 }
-
-func webSer(lis, to string) error {
-       {
-               w := pweb.New(&http.Server{
-                       Addr: "127.0.0.1:20010",
-               })
-               defer w.Shutdown()
-
-               w.Handle(map[string]func(http.ResponseWriter, *http.Request){
-                       `/`: func(w http.ResponseWriter, r *http.Request) {
-                               w.Write([]byte("999"))
-                       },
-               })
-       }
-       r := preqf.New()
-       e := r.Reqf(preqf.Rval{
-               Url: "http://127.0.0.1:20010",
-       })
-       fmt.Println(r.Respon)
-       return e
-}