Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmd/croc/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"
"time"

"github.com/schollz/croc/v9/src/croc"
"github.com/schollz/croc/v9/src/models"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,14 +61,17 @@ var ReceiveCmd = &cobra.Command{
}
relay := relays[relayIndex]

crocOptions := croc.Options{
crocOptions := Options{
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Options type is referenced without a package qualifier, but the upstream import github.com/schollz/croc/v9/src/croc has been removed. If Options is not defined in the current package or properly imported from a local package, this will result in a compilation error.

Copilot uses AI. Check for mistakes.
Curve: "p256",
Debug: false,
DisableLocal: true,
HashAlgorithm: "xxhash",
IsSender: false,
NoPrompt: true,
Overwrite: true,
RelayAddress: relay.Address,
RelayPassword: relay.Password,
RelayPorts: strings.Split(relay.Ports, ","),
SharedSecret: sharedSecretCode,
}
Comment on lines +64 to 76
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded values for Curve, Debug, DisableLocal, HashAlgorithm, NoPrompt, and Overwrite are magic values that should be defined as constants or configuration settings. This would improve maintainability and make it easier to adjust these values consistently across the codebase.

Copilot uses AI. Check for mistakes.

Expand All @@ -79,7 +81,7 @@ var ReceiveCmd = &cobra.Command{
crocOptions.RelayAddress = ""
}

cr, err := croc.New(crocOptions)
cr, err := New(crocOptions)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The New() function is called without a package qualifier, but no import statement shows where this function is defined. If New() is defined in the same package, this is correct. However, if it's intended to be from a local croc package that should be imported, this will cause a compilation error.

Copilot uses AI. Check for mistakes.
if err != nil {
log.Fatalf("croc: %v", err)
}
Expand Down
Loading