Skip to content

Commit

Permalink
go.mod v9 -> v10
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed May 23, 2024
1 parent 7acd2de commit 6181903
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/schollz/croc/v9
module github.com/schollz/croc/v10

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package main
import (
"log"

"github.com/schollz/croc/v9/src/cli"
"github.com/schollz/croc/v10/src/cli"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/comm/comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
14 changes: 7 additions & 7 deletions src/croc/croc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/croc/croc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
6 changes: 3 additions & 3 deletions src/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions src/message/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion src/models/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 16 additions & 1 deletion src/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6181903

Please sign in to comment.