1
0
mirror of https://github.com/schollz/croc synced 2024-07-01 07:04:32 +00:00

go.mod v9 -> v10

This commit is contained in:
Zack 2024-05-23 06:25:53 -07:00
parent 7acd2def69
commit 6181903c83
13 changed files with 49 additions and 34 deletions

View File

@ -10,12 +10,12 @@ install: true
script:
- env GO111MODULE=on go build -v
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/compress
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/croc
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/crypt
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/tcp
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/utils
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v9/src/comm
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/compress
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/croc
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/crypt
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/tcp
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/utils
- env GO111MODULE=on go test -v -cover github.com/schollz/croc/v10/src/comm
branches:
except:

View File

@ -108,7 +108,7 @@ pkg install croc
Or, you can [install Go](https://golang.org/dl/) and build from source (requires Go 1.17+):
```
go install github.com/schollz/croc/v9@latest
go install github.com/schollz/croc/v10@latest
```
On Android there is a 3rd party F-Droid app [available to download](https://f-droid.org/en/packages/com.github.howeyc.crocgui/).

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/schollz/croc/v9
module github.com/schollz/croc/v10
go 1.20

View File

@ -7,7 +7,7 @@ package main
import (
"log"
"github.com/schollz/croc/v9/src/cli"
"github.com/schollz/croc/v10/src/cli"
)
func main() {

View File

@ -15,11 +15,11 @@ import (
"github.com/chzyer/readline"
"github.com/schollz/cli/v2"
"github.com/schollz/croc/v9/src/comm"
"github.com/schollz/croc/v9/src/croc"
"github.com/schollz/croc/v9/src/models"
"github.com/schollz/croc/v9/src/tcp"
"github.com/schollz/croc/v9/src/utils"
"github.com/schollz/croc/v10/src/comm"
"github.com/schollz/croc/v10/src/croc"
"github.com/schollz/croc/v10/src/models"
"github.com/schollz/croc/v10/src/tcp"
"github.com/schollz/croc/v10/src/utils"
log "github.com/schollz/logger"
"github.com/schollz/mnemonicode"
"github.com/schollz/pake/v3"

View File

@ -11,7 +11,7 @@ import (
"time"
"github.com/magisterquis/connectproxy"
"github.com/schollz/croc/v9/src/utils"
"github.com/schollz/croc/v10/src/utils"
log "github.com/schollz/logger"
"golang.org/x/net/proxy"
)

View File

@ -28,13 +28,13 @@ import (
"github.com/schollz/peerdiscovery"
"github.com/schollz/progressbar/v3"
"github.com/schollz/croc/v9/src/comm"
"github.com/schollz/croc/v9/src/compress"
"github.com/schollz/croc/v9/src/crypt"
"github.com/schollz/croc/v9/src/message"
"github.com/schollz/croc/v9/src/models"
"github.com/schollz/croc/v9/src/tcp"
"github.com/schollz/croc/v9/src/utils"
"github.com/schollz/croc/v10/src/comm"
"github.com/schollz/croc/v10/src/compress"
"github.com/schollz/croc/v10/src/crypt"
"github.com/schollz/croc/v10/src/message"
"github.com/schollz/croc/v10/src/models"
"github.com/schollz/croc/v10/src/tcp"
"github.com/schollz/croc/v10/src/utils"
)
var (

View File

@ -10,7 +10,7 @@ import (
"testing"
"time"
"github.com/schollz/croc/v9/src/tcp"
"github.com/schollz/croc/v10/src/tcp"
log "github.com/schollz/logger"
"github.com/stretchr/testify/assert"
)

View File

@ -3,9 +3,9 @@ package message
import (
"encoding/json"
"github.com/schollz/croc/v9/src/comm"
"github.com/schollz/croc/v9/src/compress"
"github.com/schollz/croc/v9/src/crypt"
"github.com/schollz/croc/v10/src/comm"
"github.com/schollz/croc/v10/src/compress"
"github.com/schollz/croc/v10/src/crypt"
log "github.com/schollz/logger"
)

View File

@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/schollz/croc/v9/src/comm"
"github.com/schollz/croc/v9/src/crypt"
"github.com/schollz/croc/v10/src/comm"
"github.com/schollz/croc/v10/src/crypt"
log "github.com/schollz/logger"
"github.com/stretchr/testify/assert"
)
@ -84,7 +84,7 @@ func TestSend(t *testing.T) {
}
}()
time.Sleep(300 * time.Millisecond)
time.Sleep(800 * time.Millisecond)
a, err := comm.NewConnection("127.0.0.1:"+port, 10*time.Minute)
assert.Nil(t, err)
m := Message{Type: TypeMessage, Message: "hello, world"}

View File

@ -7,7 +7,7 @@ import (
"os"
"path"
"github.com/schollz/croc/v9/src/utils"
"github.com/schollz/croc/v10/src/utils"
)
// TCP_BUFFER_SIZE is the maximum packet size

View File

@ -11,9 +11,9 @@ import (
log "github.com/schollz/logger"
"github.com/schollz/pake/v3"
"github.com/schollz/croc/v9/src/comm"
"github.com/schollz/croc/v9/src/crypt"
"github.com/schollz/croc/v9/src/models"
"github.com/schollz/croc/v10/src/comm"
"github.com/schollz/croc/v10/src/crypt"
"github.com/schollz/croc/v10/src/models"
)
type server struct {

View File

@ -208,9 +208,24 @@ func TestGetRandomName(t *testing.T) {
assert.NotEmpty(t, name)
}
func intSliceSame(a, b []int) bool {
if len(a) != len(b) {
return false
}
for i, v := range a {
if v != b[i] {
return false
}
}
return true
}
func TestFindOpenPorts(t *testing.T) {
openPorts := FindOpenPorts("127.0.0.1", 9009, 4)
assert.Equal(t, []int{9009, 9010, 9011, 9012}, openPorts)
if !intSliceSame(openPorts, []int{9009, 9010, 9011, 9012}) && !intSliceSame(openPorts, []int{9014, 9015, 9016, 9017}) {
t.Errorf("openPorts: %v", openPorts)
}
}
func TestIsLocalIP(t *testing.T) {