Skip to content
New issue

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

Bug: common_string.go:66:6: __xgo_orig__ redeclared in this block #118

Closed
xhd2015 opened this issue May 18, 2024 · 0 comments
Closed

Bug: common_string.go:66:6: __xgo_orig__ redeclared in this block #118

xhd2015 opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working mock

Comments

@xhd2015
Copy link
Owner

xhd2015 commented May 18, 2024

When setting up mocks for functions with name _, xgo fails with this message.

The function is from GOROOT/src/crypto/tls/common_string.go:

func _() {
	// An "invalid array index" compiler error signifies that the constant values have changed.
	// Re-run the stringer command to generate them again.
	var x [1]struct{}
	_ = x[CurveP256-23]
	_ = x[CurveP384-24]
	_ = x[CurveP521-25]
	_ = x[X25519-29]
}

It seems that func name _ is a special placeholder, which can never be called. So it is reasonable to skip trapping these functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mock
Projects
None yet
Development

No branches or pull requests

1 participant