We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running unit test, some packages are annoying.Though we are not going to use it while testing, it still stops testing.
Example: vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go
vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go
func init() { if !structsEqual(&tls.ConnectionState{}, &qtls.ConnectionState{}) { panic("qtls.ConnectionState not compatible with tls.ConnectionState") } if !structsEqual(&tls.ClientSessionState{}, &qtls.ClientSessionState{}) { panic("qtls.ClientSessionState not compatible with tls.ClientSessionState") } }
I want to rewrite it into
func init() { if true { return } if !structsEqual(&tls.ConnectionState{}, &qtls.ConnectionState{}) { panic("qtls.ConnectionState not compatible with tls.ConnectionState") } if !structsEqual(&tls.ClientSessionState{}, &qtls.ClientSessionState{}) { panic("qtls.ClientSessionState not compatible with tls.ClientSessionState") } }
The text was updated successfully, but these errors were encountered:
A solution that does not require changing xgo, using shell to help patch and restore the source file:
#!/usr/bin/env bash patch_file=vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go orig_content=$(cat "$patch_file") function apply_patch_file { cat > "$patch_file" <<EOF //go:build ignore // +build ignore $orig_content EOF } function restore_patch_file { echo "$orig_content" > "$patch_file" } apply_patch_file trap restore_patch_file EXIT xgo test -mod=vendor -v ./...
Sorry, something went wrong.
No branches or pull requests
When running unit test, some packages are annoying.Though we are not going to use it while testing, it still stops testing.
Example:
vendor/github.com/lucas-clemente/quic-go/internal/handshake/unsafe.go
I want to rewrite it into
The text was updated successfully, but these errors were encountered: