-
Notifications
You must be signed in to change notification settings - Fork 13
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
Autogenerate cgo wrappers #230
base: v2
Are you sure you want to change the base?
Conversation
Copilot
AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 31 out of 46 changed files in this pull request and generated 3 suggestions.
Files not reviewed (15)
- goopenssl.c: Language not supported
- goopenssl.h: Language not supported
- export_test.go: Evaluated as low risk
- ed25519.go: Evaluated as low risk
- ecdsa.go: Evaluated as low risk
- ec.go: Evaluated as low risk
- ecdh.go: Evaluated as low risk
- aes.go: Evaluated as low risk
- des.go: Evaluated as low risk
- evp.go: Evaluated as low risk
- hkdf.go: Evaluated as low risk
- hash.go: Evaluated as low risk
- cipher.go: Evaluated as low risk
- hmac.go: Evaluated as low risk
- init.go: Evaluated as low risk
Comments skipped due to low confidence (8)
internal/mkcgo/parse.go:191
- The extractSection function does not handle cases where the start or end strings are not found properly. It might return incorrect results.
func extractSection(s string, start, end string) (prefix, body, suffix string, found bool) {
internal/mkcgo/parse.go:137
- The newFn function has a lot of string manipulation which could be error-prone. Ensure that it handles edge cases properly.
func newFn(s string, opts fnOptions) (*fn, error) {
internal/mkcgo/mkcgo.go:62
- Handle the case where fileName is empty to avoid unexpected behavior.
err = os.WriteFile(*fileName, data, 0644)
internal/mkcgo/mkcgo.go:64
- Ensure fileName ends with .go before using TrimSuffix to avoid incorrect file naming.
cfileName := strings.TrimSuffix(*fileName, ".go") + ".c"
internal/mkcgo/mkcgo.go:132
- [nitpick] Simplify the error handling for better readability.
if closeErr := f.Close(); err == nil { err = closeErr }
internal/mkcgo/generate.go:244
- The function
libArgList
in theparam
struct returns a slice with a single string element, which is unnecessary. It should return a string directly.
return []string{s}
dsa.go:58
- The function signature for withKey has been changed from func(C.GO_EVP_PKEY_PTR) C.int to func(ossl.EVP_PKEY_PTR) error. Ensure that the functions passed to withKey are updated to handle errors correctly.
func (k *PrivateKeyDSA) withKey(f func(ossl.EVP_PKEY_PTR) error) error {
ecdsa_test.go:25
- The removal of
t.Parallel()
should be justified. If there were no issues with parallel execution, consider adding it back to improve test performance.
t.Parallel()
044ae27
to
13e70e5
Compare
PoC, do not review yet.