Skip to content

SA1019: httputil.ClientConn has been deprecated since Go 1.0: Use Client or Transport in package net/http instead. #919

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

Closed
EtienneM opened this issue Mar 24, 2023 · 2 comments · Fixed by #1090
Assignees
Labels

Comments

@EtienneM
Copy link
Member

apps/run.go:350:12: SA1019: httputil.ClientConn has been deprecated since Go 1.0: Use Client or Transport in package net/http instead. (staticcheck)                                          
        var conn *httputil.ClientConn                                                                                                                                                         
                  ^                                                                            
apps/run.go:356:10: SA1019: httputil.NewClientConn has been deprecated since Go 1.0: Use the Client or Transport in package net/http instead. (staticcheck)                                   
                conn = httputil.NewClientConn(tlsConn, nil)                                                                                                                                   
                       ^                                                                                                                                                                      
apps/run.go:358:10: SA1019: httputil.NewClientConn has been deprecated since Go 1.0: Use the Client or Transport in package net/http instead. (staticcheck)                                   
                conn = httputil.NewClientConn(dial, nil)                                                                                                                                      
@EtienneM EtienneM added the low label Mar 24, 2023
@EtienneM
Copy link
Member Author

I tried to find a solution but didn't succeed. There is no more HTTP client hijack in Go (golang/go#28030). Hence we need to figure out another way to make the underlying TCP connection bidirectional.

@briceamen briceamen self-assigned this Dec 6, 2024
briceamen added a commit that referenced this issue Dec 12, 2024
…ality

Fix #919

BREAKING CHANGE: Remove usage of deprecated httputil.ClientConn in favor of net/http.Client
per golang/go#28030. Since HTTP connection hijacking is no longer supported in modern Go,
implemented alternative approach for bidirectional TCP communication.
@briceamen
Copy link
Contributor

Hi @EtienneM,

I've created a draft PR addressing the httputil.ClientConn deprecation.

I've tested this successfully locally and on staging through run bash is there any other one-off situation that I should test ?

Moreover I wasn't able to add unit tests yet due to issues importing the run service mock. I'll need some help with the mocking setup to complete the test coverage.

Let me know what you think about this approach!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants