Description
Description
In the file pkg/tcpip/stack/bridge_test.go
, the package name is incorrectly set to bridge_test
, which causes a compilation error due to conflicting package names in the same directory (stack
and bridge
). According to Go conventions, all files in the same directory should belong to the same package unless explicitly using external test packages (*_test
packages), which does not appear to be the case here.
Steps to Reproduce
-
Create a new Go application:
mkdir gvisor-test-app cd gvisor-test-app go mod init gvisor-test-app
-
Execute
go get
to install the specified version of gVisor:go get gvisor.dev/[email protected]
-
Create a simple program that uses the
gvisor.dev/gvisor/pkg/tcpip/stack
package. Create amain.go
file with the following content:package main import ( "fmt" "gvisor.dev/gvisor/pkg/tcpip/stack" ) func main() { // Create a simple TCP/IP stack instance s := stack.New(stack.Options{}) // Print the stack instance fmt.Println("Created a new stack instance:", s) }
-
Run the program with
go run main.go
. You should see a compilation error due to the conflicting package names inpkg/tcpip/stack/bridge_test.go
.
Expected Behavior
The package name in bridge_test.go
should be consistent with other files in the directory and likely renamed to stack_test
to resolve the conflict and follow Go conventions.
Environment
- gVisor version:
v0.0.0-20250307022211-9581066c3038
- Go version:
1.23.7
- OS: Windows 11, amd64
Additional Context
This issue might have been introduced unintentionally and can be resolved by renaming the package in bridge_test.go
to stack_test
.
Activity