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

Fix go vet warnings #181

Closed
wants to merge 1 commit into from
Closed

Conversation

jabley
Copy link

@jabley jabley commented Aug 19, 2016

These were noticed using Go 1.7. Earlier versions may not have had all
of these issues.

  • https.go:376: assignment copies lock value to config:
    crypto/tls.Config contains sync.Once contains sync.Mutex
  • examples/goproxy-yui-minify/yui.go:79: io.LimitedReader composite
    literal uses unkeyed fields
  • proxy_test.go:508: unreachable code
  • transport/transport.go:308: unreachable code
  • transport/transport.go:658: unreachable code

These were noticed using Go 1.7. Earlier versions may not have had all
of these issues.

- https.go:376: assignment copies lock value to config:
  crypto/tls.Config contains sync.Once contains sync.Mutex
- examples/goproxy-yui-minify/yui.go:79: io.LimitedReader composite
  literal uses unkeyed fields
- proxy_test.go:508: unreachable code
- transport/transport.go:308: unreachable code
- transport/transport.go:658: unreachable code
jabley added a commit to jabley/countryproxy that referenced this pull request Aug 19, 2016
@@ -373,14 +373,14 @@ func (proxy *ProxyHttpServer) NewConnectDialToProxy(https_proxy string) func(net

func TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *ProxyCtx) (*tls.Config, error) {
return func(host string, ctx *ProxyCtx) (*tls.Config, error) {
config := *defaultTLSConfig
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that a bug? You leak the defaultTLSConfig, and users can change it by mistake.

@elazarl
Copy link
Owner

elazarl commented Aug 24, 2016

Hi!
Did you see my comment?
Am I correct?

@jabley
Copy link
Author

jabley commented Dec 8, 2016

I think using this should address it, once Go 1.8 is out.

@elazarl
Copy link
Owner

elazarl commented Dec 13, 2016 via email

@jabley
Copy link
Author

jabley commented Dec 13, 2016

Will do, once Go 1.8 is out in January 2017.

@elazarl
Copy link
Owner

elazarl commented Dec 13, 2016 via email

@ErikPelli
Copy link
Collaborator

Fixed in #595

@ErikPelli ErikPelli closed this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants