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

wrong usage of strings.TrimPrefix #1

Closed
bangert opened this issue Aug 23, 2017 · 1 comment
Closed

wrong usage of strings.TrimPrefix #1

bangert opened this issue Aug 23, 2017 · 1 comment

Comments

@bangert
Copy link

bangert commented Aug 23, 2017

https://golang.org/pkg/strings/#TrimPrefix

[bangert@stuart grayproxy]$ git diff .
diff --git a/app.go b/app.go
index cb07fd1..4edb6d9 100644
--- a/app.go
+++ b/app.go
@@ -90,7 +90,7 @@ func (app *app) configure() (err error) {
                case strings.HasPrefix(v, "http://") || strings.HasPrefix(v, "https://"):
                        app.outs[i] = &httpSender{Address: v, SendTimeout: app.sendTimeout}
                default:
-                       app.outs[i] = &tcpSender{Address: strings.TrimPrefix("tcp://", v), SendTimeout: app.sendTimeout}
+                       app.outs[i] = &tcpSender{Address: strings.TrimPrefix(v, "tcp://"), SendTimeout: app.sendTimeout}
                }
                log.Printf("Added output %d: %s", i, v)
        }
@andviro
Copy link
Owner

andviro commented Aug 23, 2017

Thanks!

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

No branches or pull requests

2 participants